随笔分类 - 前端
摘要:案例1 参考 代码 <!-- 此示例下载自 https://echarts.apache.org/examples/zh/editor.html?c=candlestick-simple --> <!DOCTYPE html> <html lang="en" style="height: 100%"
阅读全文
摘要:案例1 参考 代码 <!-- 此示例下载自 https://echarts.apache.org/examples/zh/editor.html?c=heatmap-cartesian --> <!DOCTYPE html> <html lang="en" style="height: 100%">
阅读全文
摘要:jsMind编写思维导图 代码案例 使用文档 案例1 <html> <head> <!-- <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.8.1/style/jsmind.css" /> <script
阅读全文
摘要:用法 链接 新建html文件,复制如下 <!doctype html> <html> <head> <title>Embedding Vega-Lite</title> <script src="https://cdn.jsdelivr.net/npm/vega@5.25.0"></script>
阅读全文
摘要:参考0,参考1,参考2,参考3,参考4 编写轮播图 <!doctype html> <html> <head> <meta charset="utf-8"> <title>bulletin_board</title> <link rel="stylesheet" href="./bootstrap.
阅读全文
摘要:构建项目 // 安装angular-cli npm install -g @angular/cli // 创建项目 ng new angular01 // 是否安装路由 // 选择(css/less/sass) // 进入项目 cd angular01 // 安装依赖 npm install //
阅读全文
摘要:npm # 初始化,方式1 npm init # 初始化,方式2 npm init -y # 安装依赖 npm install [package] # 安装项目所有依赖 npm install # 强制下载安装 npm installnpm install --force # 升级 npm upda
阅读全文
摘要:npm 从5.2版开始,增加了 npx 命令 如果不能用,就要手动安装一下 npm install -g npx 创建项目 // 创建项目 npx create-nuxt-app <项目名> // 项目名称 Project name: (nuxt01) // 程序设计语言 Programming l
阅读全文
摘要:vite1构建项目 cnpm i create-vite-app # 安装vite npm init vite-app demo01 # 使用vite创建vue项目 cd demo01 npm install npm run dev vite2构建项目 npm init @vitejs/app cd
阅读全文
摘要:初始化项目 cnpm i create-vite-app # 安装vite npm init vite-app vue03 # 使用vite创建vue项目 cd vue03 npm install npm run dev 整合element-plus 官网 安装 npm install elemen
阅读全文
摘要:初始化项目 npm init @vitejs/app cd vue02 npm install npm run dev 安装less、less-loader npm install less npm install less-loader@5.0.0 嵌套 // 根组件中template标签中编写h
阅读全文
摘要:vite1 + vant 初始化项目 npm init vite-app vant01 cd vant01 npm install npm run dev 安装vant yarn add vant@3.1.4 -D 入口文件main.js中引入vant并注册为vue实例的属性 import { cr
阅读全文
摘要:优化1 // store import { createStore } from 'vuex' export default createStore({ state: { count: 0 }, mutations: { sub(state) { state.count--; } }, action
阅读全文
摘要:getters用于封装store中的共享数据 // store import { createStore } from 'vuex' export default createStore({ state: { count: 0 }, mutations: { }, actions: { }, get
阅读全文
摘要:在store的mutations函数中不能执行异步操作,例如不能使用setTimeout()方法 只有mutations才能操作state中的数据,只有actions才能操作mutations中的方法 actions操作mutations中的函数,方式1 // store import { crea
阅读全文
摘要:Mutation用于变更Store中的数据 方式1 // 例如在store中写一个操作data的方法add,传入的参数为要操作的数据state import { createStore } from 'vuex' export default createStore({ state: { count
阅读全文
摘要:使用vue-cli构建1个vue项目 安装vuex npm install vuex --save src目录下新建store文件夹,新建index.js import { createStore } from 'vuex' export default createStore({ state: {
阅读全文
摘要:案例1:命名视图 # app.js var routes = [ { path: '/users', components: { sidebar: { template: ` <div> <ul> <li>用户管理</li> <li>权限管理</li> </ul> </div> ` }, conte
阅读全文
摘要:案例1:子路由 # app.js var routes = [ { path: '/user/:name', name: 'user', component: { template: ` <div> <h3>我叫:{{$route.params.name}}</h3> <h3>我今年:{{$rout
阅读全文
摘要:案例1 # app.js var routes = [ { path: '/', component: { template: ` <div><h3>首页</h3></div> ` } }, { path: '/about', component: { template: ` <div><h3>关于
阅读全文