
pnpm dev)(步骤 ②)。注:scripts/dev.js 默认已配置 sourcemap: truepnpm serve)(步骤 ③).vscode/launch.json 文件。在 VSCode - Run and Debug 中选择 Add Configuration...,配置为 Chrome: Launch

pnpm serve 中的端口(步骤 ①)已有调试代码在 packages/vue/examples
可参考已有调试代码进行相关调试代码编写,注入 dist/vue.global.js 即可
<script src="../../dist/vue.global.js"></script>
<div id="app">
<!-- HTML -->
</div>
<script>
const { createApp, reactive } = Vue
const func = () => {}
createApp({
setup() {
const state = reactive({
// non-privimte data
})
return {
state,
}
},
directives: {
'todo-focus': (el, { value }) => {
if (value) {
el.focus()
}
}
}
}).mount('#app')
</script>