vue
一. 动态加载图片 (以vue模板为例)
app.vue 代码如下:
<template> <div id="app"> <img :src="Url" :class="icont"> <router-view></router-view> </div> </template> <script> export default { name: 'app', data () { return { icont: 'play', Url: require('./assets/logo.png') } } } </script>
二. 取消格式验证;(针对vue-cli脚手架)
1.创建模板时 Use ESLint to lint your code? No
2. 注释或删除以下代码后,重新打开编辑器
build --->webpack.base.conf.js
{ test: /.(js|vue)$/, loader: 'eslint-loader', enforce: 'pre', include: [resolve('src'), resolve('test')], options: { formatter: require('eslint-friendly-formatter') } }