vue 萌新求助!为啥 template 不能替换掉 相应的 tag
資深大佬 : asanelder 1
index.html
<html> <head> <title>Vue Hello World</title> </head> <body>
大佬有話說 (17)
<html> <head> <title>Vue Hello World</title> </head> <body>
我自己想用 webpack 来打包一个简单的 vue single file components,目的就是想了解一下原理。。。
说实话,看官方文档没找到原因。
主要是 webpack 最后打包成的 bundle.js 不包含 vue-compile, 所以 template: ‘<p> test </p>’ 是不起作用的。
要想起作用,需要使用 SFC 或者 render 函数。
大家不用回复了哈