當我把頁面的 vue 模板寫在 .html 文件裏的時候, html-webpack-plugin 打包 html 文件的時候,會自己先過一遍,然後比如頁面中有類似 `xxxxx${xx}`的東西,它就會說 xx is undefined!
需要在 rule 裏用 html-loader 去加載 .html 文件就可以了。
{
test: /\.html$/,
loader: 'html-loader'
}
當我把頁面的 vue 模板寫在 .html 文件裏的時候, html-webpack-plugin 打包 html 文件的時候,會自己先過一遍,然後比如頁面中有類似 `xxxxx${xx}`的東西,它就會說 xx is undefined!
需要在 rule 裏用 html-loader 去加載 .html 文件就可以了。
{
test: /\.html$/,
loader: 'html-loader'
}
項目中需要按照不同的媒體類型,展示不同的表頭且數據字段也不同。可以增加不同key值解決v-if不生效問題。 <el-table-column prop="author" align="center"
修改ejs文件 將<% if (!process.browser) {%> 改成: <% if (!require(‘process’).browser) { %>