Vuejs 使用介绍
安装
npm i -g @vue/cli
创建项目
vue create <name>
cd <name>
npm run serve
运行
npm install
npm run build
npm run dev
插件
https://github.com/vuejs/vue-devtools
clean-webpack-plugin
Installation, in webpack project home dir:
npm install --save-dev clean-webpack-plugin
Usage, add to webpack.config.js:
const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpackConfig = {
plugins: [
/**
* All files inside webpack's output.path directory will be removed once, but the
* directory itself will not be. If using webpack 4+'s default configuration,
* everything under <PROJECT_DIR>/dist/ will be removed.
* Use cleanOnceBeforeBuildPatterns to override this behavior.
*
* During rebuilds, all webpack assets that are not used anymore
* will be removed automatically.
*
* See `Options and Defaults` for for information
*/
new CleanWebpackPlugin(),
],
};
module.exports = webpackConfig;
ref: https://github.com/johnagan/clean-webpack-plugin
问题
跨域问题
chrome
安装 Moesif Orign & CORS Changer
插件,并开启
?raw 什么作用
import richtextRedo from '../assets/richtext_redo.svg?raw';