Skip to content

Commit

Permalink
fix: 变量 libName 是中横线字符,demo 页面读取时报错。
Browse files Browse the repository at this point in the history
  • Loading branch information
dear-lizhihua committed May 25, 2023
1 parent f0f254e commit 27e5c6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<% } %>

<script>
console.log(<%- htmlWebpackPlugin.options.libName %>)
console.log(globalThis['<%- htmlWebpackPlugin.options.libName %>'])
</script>
4 changes: 2 additions & 2 deletions packages/@vue/cli-service/lib/commands/build/demo-lib.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
<% if (htmlWebpackPlugin.options.vueMajor === 3) { %>
Vue.createApp({
components: {
demo: <%- htmlWebpackPlugin.options.libName %>
demo: globalThis['<%- htmlWebpackPlugin.options.libName %>']
}
}).mount('#app')
<% } else { %>
new Vue({
components: {
demo: <%- htmlWebpackPlugin.options.libName %>
demo: globalThis['<%- htmlWebpackPlugin.options.libName %>']
}
}).$mount('#app')
<% } %>
Expand Down

0 comments on commit 27e5c6b

Please sign in to comment.