style: fix format in vapor

This commit is contained in:
Rizumu Ayaka 2023-12-29 22:11:33 +08:00
parent dce55475a5
commit d06aac7aa2
No known key found for this signature in database
9 changed files with 27 additions and 22 deletions

View File

@ -1 +1 @@
export * from './index.js'
export * from './index.js'

View File

@ -6,7 +6,7 @@ export function initDev() {
if (!__ESM_BUNDLER__) {
console.info(
`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.`,
)
}

View File

@ -20,7 +20,7 @@ export const compile = () => {
? ` Use "vue-vapor.esm-browser.js" instead.`
: __GLOBAL__
? ` Use "vue-vapor.global.js" instead.`
: ``) /* should not happen */
: ``) /* should not happen */,
)
}
}

View File

@ -34,8 +34,8 @@ export function DevPlugin({ browser = false } = {}) {
'@vue/compiler-ssr': resolve('compiler-ssr/src'),
'@vue/reactivity': resolve('reactivity/src'),
'@vue/shared': resolve('shared/src')
}
'@vue/shared': resolve('shared/src'),
},
},
define: {
__COMMIT__: `"__COMMIT__"`,
@ -59,9 +59,9 @@ export function DevPlugin({ browser = false } = {}) {
// feature flags
__FEATURE_SUSPENSE__: `true`,
__FEATURE_OPTIONS_API__: `true`,
__FEATURE_PROD_DEVTOOLS__: `false`
}
__FEATURE_PROD_DEVTOOLS__: `false`,
},
}
}
},
}
}

View File

@ -8,7 +8,7 @@ startVite(
{ plugins: [DevPlugin()] },
{
deps: {
inline: ['@vitejs/plugin-vue']
}
}
inline: ['@vitejs/plugin-vue'],
},
},
)

View File

@ -4,7 +4,7 @@ import {
computed,
onMounted,
onBeforeMount,
getCurrentInstance
getCurrentInstance,
} from 'vue/vapor'
const instance = getCurrentInstance()!

View File

@ -16,7 +16,7 @@ const vDirective: ObjectDirective<HTMLDivElement, undefined> = {
},
mounted(node) {
if (node.parentElement) node.textContent += 'mounted, '
}
},
}
const vDirectiveSimple: FunctionDirective<HTMLDivElement> = (node, binding) => {
console.log(node, binding)

View File

@ -1,5 +1,12 @@
<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 add = () => source.value++
@ -39,9 +46,7 @@ const onUpdate = (arg: any) => {
<div>
<p>Please check the console</p>
<div>
<button @click="add">
Add
</button>
<button @click="add">Add</button>
|
<span>{{ onUpdate(source) }}</span>
</div>

View File

@ -7,17 +7,17 @@ import * as CompilerSFC from '@vue/compiler-sfc'
export default defineConfig({
build: {
target: 'esnext'
target: 'esnext',
},
clearScreen: false,
plugins: [
Vue({
template: {
compiler: CompilerVapor as any
compiler: CompilerVapor as any,
},
compiler: CompilerSFC
compiler: CompilerSFC,
}),
DevPlugin(),
Inspect()
]
Inspect(),
],
})