mirror of https://github.com/vuejs/core.git
style: fix format in vapor
This commit is contained in:
parent
dce55475a5
commit
d06aac7aa2
|
@ -1 +1 @@
|
||||||
export * from './index.js'
|
export * from './index.js'
|
||||||
|
|
|
@ -6,7 +6,7 @@ export function initDev() {
|
||||||
if (!__ESM_BUNDLER__) {
|
if (!__ESM_BUNDLER__) {
|
||||||
console.info(
|
console.info(
|
||||||
`You are running a development build of Vue.\n` +
|
`You are running a development build of Vue.\n` +
|
||||||
`Make sure to use the production build (*.prod.js) when deploying for production.`
|
`Make sure to use the production build (*.prod.js) when deploying for production.`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const compile = () => {
|
||||||
? ` Use "vue-vapor.esm-browser.js" instead.`
|
? ` Use "vue-vapor.esm-browser.js" instead.`
|
||||||
: __GLOBAL__
|
: __GLOBAL__
|
||||||
? ` Use "vue-vapor.global.js" instead.`
|
? ` Use "vue-vapor.global.js" instead.`
|
||||||
: ``) /* should not happen */
|
: ``) /* should not happen */,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ export function DevPlugin({ browser = false } = {}) {
|
||||||
'@vue/compiler-ssr': resolve('compiler-ssr/src'),
|
'@vue/compiler-ssr': resolve('compiler-ssr/src'),
|
||||||
|
|
||||||
'@vue/reactivity': resolve('reactivity/src'),
|
'@vue/reactivity': resolve('reactivity/src'),
|
||||||
'@vue/shared': resolve('shared/src')
|
'@vue/shared': resolve('shared/src'),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
__COMMIT__: `"__COMMIT__"`,
|
__COMMIT__: `"__COMMIT__"`,
|
||||||
|
@ -59,9 +59,9 @@ export function DevPlugin({ browser = false } = {}) {
|
||||||
// feature flags
|
// feature flags
|
||||||
__FEATURE_SUSPENSE__: `true`,
|
__FEATURE_SUSPENSE__: `true`,
|
||||||
__FEATURE_OPTIONS_API__: `true`,
|
__FEATURE_OPTIONS_API__: `true`,
|
||||||
__FEATURE_PROD_DEVTOOLS__: `false`
|
__FEATURE_PROD_DEVTOOLS__: `false`,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ startVite(
|
||||||
{ plugins: [DevPlugin()] },
|
{ plugins: [DevPlugin()] },
|
||||||
{
|
{
|
||||||
deps: {
|
deps: {
|
||||||
inline: ['@vitejs/plugin-vue']
|
inline: ['@vitejs/plugin-vue'],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
computed,
|
computed,
|
||||||
onMounted,
|
onMounted,
|
||||||
onBeforeMount,
|
onBeforeMount,
|
||||||
getCurrentInstance
|
getCurrentInstance,
|
||||||
} from 'vue/vapor'
|
} from 'vue/vapor'
|
||||||
|
|
||||||
const instance = getCurrentInstance()!
|
const instance = getCurrentInstance()!
|
||||||
|
|
|
@ -16,7 +16,7 @@ const vDirective: ObjectDirective<HTMLDivElement, undefined> = {
|
||||||
},
|
},
|
||||||
mounted(node) {
|
mounted(node) {
|
||||||
if (node.parentElement) node.textContent += 'mounted, '
|
if (node.parentElement) node.textContent += 'mounted, '
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
const vDirectiveSimple: FunctionDirective<HTMLDivElement> = (node, binding) => {
|
const vDirectiveSimple: FunctionDirective<HTMLDivElement> = (node, binding) => {
|
||||||
console.log(node, binding)
|
console.log(node, binding)
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onEffectCleanup, ref, watch, watchEffect, watchPostEffect, watchSyncEffect } from 'vue/vapor'
|
import {
|
||||||
|
onEffectCleanup,
|
||||||
|
ref,
|
||||||
|
watch,
|
||||||
|
watchEffect,
|
||||||
|
watchPostEffect,
|
||||||
|
watchSyncEffect,
|
||||||
|
} from 'vue/vapor'
|
||||||
|
|
||||||
const source = ref(0)
|
const source = ref(0)
|
||||||
const add = () => source.value++
|
const add = () => source.value++
|
||||||
|
@ -39,9 +46,7 @@ const onUpdate = (arg: any) => {
|
||||||
<div>
|
<div>
|
||||||
<p>Please check the console</p>
|
<p>Please check the console</p>
|
||||||
<div>
|
<div>
|
||||||
<button @click="add">
|
<button @click="add">Add</button>
|
||||||
Add
|
|
||||||
</button>
|
|
||||||
|
|
|
|
||||||
<span>{{ onUpdate(source) }}</span>
|
<span>{{ onUpdate(source) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,17 +7,17 @@ import * as CompilerSFC from '@vue/compiler-sfc'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
target: 'esnext'
|
target: 'esnext',
|
||||||
},
|
},
|
||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
Vue({
|
Vue({
|
||||||
template: {
|
template: {
|
||||||
compiler: CompilerVapor as any
|
compiler: CompilerVapor as any,
|
||||||
},
|
},
|
||||||
compiler: CompilerSFC
|
compiler: CompilerSFC,
|
||||||
}),
|
}),
|
||||||
DevPlugin(),
|
DevPlugin(),
|
||||||
Inspect()
|
Inspect(),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue