Vue.Chrome扩展中的js
你好我正在try 使用Vue制作一个Chrome扩展.但是当我写作的时候
<input v-model="email" type="email" class="form-control" placeholder="Email">
Chrome删除了代码中的v型部分,并使其
<input type="email" class="form-control" placeholder="Email">
有没有办法防止这种情况发生?
你好我正在try 使用Vue制作一个Chrome扩展.但是当我写作的时候
<input v-model="email" type="email" class="form-control" placeholder="Email">
Chrome删除了代码中的v型部分,并使其
<input type="email" class="form-control" placeholder="Email">
有没有办法防止这种情况发生?
你有csp版本(Vue.js v1)吗
符合CSP的构建
Some environments, such as Google Chrome Apps, enforces Content Security Policy (CSP) and does not allow the use of new Function() for evaluating expressions. In these cases you can use the 符合CSP的构建 instead.
(Vue.js v1)http://v1.vuejs.org/guide/installation.html#CSP-compliant-build
npm install vue@csp --save
"dependencies": {
"vue": "1.0.26-csp"
}
新版本(Vue.js v2)https://vuejs.org/v2/guide/installation.html#CSP-environments
一些环境,如谷歌Chrome应用程序,强制执行内容安全策略(CSP),该策略禁止使用new Function()计算表达式.独立构建依赖于此功能来编译模板,因此在这些环境中无法使用.
然而,有一个解决办法.当在带有Webpack+Vue loader或Browserify+vueify的构建系统中使用Vue时,您的模板将预编译为在CSP环境中完美工作的渲染函数.