08 2022 档案

摘要:1 阅读全文
posted @ 2022-08-31 15:19 杨建鑫 阅读(12) 评论(0) 推荐(0) 编辑
摘要:使用<template> import { defineStore } from 'pinia' // 用到其他store的信息 import useCounter from './counter' const useUser = defineStore('user',{ state:()=>({ 阅读全文
posted @ 2022-08-31 10:28 杨建鑫 阅读(636) 评论(0) 推荐(0) 编辑
摘要:使用 : <template> <div class="id"> <h3>姓名: {{ userStore.name }}</h3> <h3>年龄: {{ userStore.age }}</h3> <h3>等级: {{ userStore.level }}</h3> <h3>简化版姓名: {{ n 阅读全文
posted @ 2022-08-31 09:51 杨建鑫 阅读(9) 评论(0) 推荐(0) 编辑
摘要:固定不变的 : stores/index.js import { createPinia } from "pinia" const pinia = createPinia() export default pinia main.js import { createApp } from 'vue' i 阅读全文
posted @ 2022-08-30 16:08 杨建鑫 阅读(69) 评论(0) 推荐(0) 编辑
摘要:store/modules/home.js export default { state: { // 服务器数据 banners: [], recommends: [] }, mutations: { changeBanners(state, banners) { state.banners = b 阅读全文
posted @ 2022-08-30 14:13 杨建鑫 阅读(76) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> <h3>Home Page</h3> <ul> <template v-for="item in $store.state.banners" :key="item.acm"> <li>{{ item.title }}</li> </templ 阅读全文
posted @ 2022-08-30 13:47 杨建鑫 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-30 11:20 杨建鑫 阅读(8) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h 阅读全文
posted @ 2022-08-30 10:53 杨建鑫 阅读(498) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h 阅读全文
posted @ 2022-08-30 10:43 杨建鑫 阅读(527) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h 阅读全文
posted @ 2022-08-29 18:14 杨建鑫 阅读(880) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h 阅读全文
posted @ 2022-08-29 18:04 杨建鑫 阅读(235) 评论(0) 推荐(0) 编辑
摘要:app.vue <template> <div class="app"> <h3>在模板中直接使用(vue2-3都可用)</h3> 计算 : {{ $store.getters.counterGetter }} <br/> 年龄 : {{ $store.getters.usersAgesGetter 阅读全文
posted @ 2022-08-29 17:21 杨建鑫 阅读(376) 评论(0) 推荐(0) 编辑
摘要:import { createStore } from 'vuex' export default createStore({ state: { nameVuex:'yjx', levelVuex:100, avtarURLVuex:'http', counterVuex:100, friends: 阅读全文
posted @ 2022-08-29 17:20 杨建鑫 阅读(1443) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> <h3> 在模板中直接使用(vue2-3都可用) </h3> 姓名 : {{ $store.state.nameVuex }} 等级 : {{ $store.state.levelVuex }} 头像 : {{ $store.state.av 阅读全文
posted @ 2022-08-29 16:17 杨建鑫 阅读(327) 评论(0) 推荐(0) 编辑
摘要:app.vue <template> <div class="app"> <h3> 在模板中直接使用 </h3> 姓名 : {{ $store.state.nameVuex }} 等级 : {{ $store.state.levelVuex }} 头像 : {{ $store.state.avtar 阅读全文
posted @ 2022-08-29 15:51 杨建鑫 阅读(196) 评论(0) 推荐(0) 编辑
摘要:// 对实例配置拦截器 // 请求拦截器 - 参数1:成功(一般参数叫config) 参数2:失败 axios.interceptors.request.use((config) => { console.log("请求成功的拦截") // 1.开始loading的动画 // 2.对原来的配置进行一 阅读全文
posted @ 2022-08-29 12:08 杨建鑫 阅读(47) 评论(0) 推荐(0) 编辑
摘要:// axios默认库提供给我们的实例对象 axios.get("http://123.207.32.32:9001/lyric?id=500665346") // 创建其他的实例发送网络请求 create 返回 一个新的实例 const instance1 = axios.create({ bas 阅读全文
posted @ 2022-08-29 11:59 杨建鑫 阅读(211) 评论(0) 推荐(0) 编辑
摘要:// 2.axios发送多个请求 // Promise.all axios.all([ axios.get("http://123.207.32.32:8000/home/multidata"), axios.get("http://123.207.32.32:9001/lyric?id=50066 阅读全文
posted @ 2022-08-29 11:51 杨建鑫 阅读(189) 评论(0) 推荐(0) 编辑
摘要:// 1.发送get请求 axios.get(`http://123.207.32.32:9001/lyric?id=500665346`).then(res => { console.log("res:", res.data.lrc) }) axios.get("http://123.207.32 阅读全文
posted @ 2022-08-29 11:35 杨建鑫 阅读(75) 评论(0) 推荐(0) 编辑
摘要:1.特点 : 1.在浏览器中发送 XMLHttpRequest 请求 2.在node.js 中发送 http 请求 3.支持Promise API 4.拦截请求和响应 2.支持多种请求方式: axios(config) axios.request(config) axios.get(url[, co 阅读全文
posted @ 2022-08-29 11:08 杨建鑫 阅读(169) 评论(0) 推荐(0) 编辑
摘要:import { useRouter } from 'vue-router' const router = useRouter() router.push({ path: "/about", query: { name: "why", age: 18 } }) 如何得到query呢 ? 模板中 : 阅读全文
posted @ 2022-08-25 15:50 杨建鑫 阅读(22) 评论(0) 推荐(0) 编辑
摘要:在路由配置里面,路径后面加 /:值 ,那么路径就会有了参数 例子 : { name:'home', path:'/home/:abc', component:Home } <router-link to="/home/875">Home</router-link> <router-link to=" 阅读全文
posted @ 2022-08-25 15:29 杨建鑫 阅读(37) 评论(0) 推荐(0) 编辑
摘要:1.路由里面的 redirect 重定向 redirect 重定向 : 把 '/' 直接定到 '/home' 去 {path:'/',redirect:'/home'}, // redirect 重定向 : 把 '/' 直接定到 '/home' 去 {path:'/',redirect:'/home 阅读全文
posted @ 2022-08-25 15:28 杨建鑫 阅读(231) 评论(0) 推荐(0) 编辑
摘要:<template> <div>AppContent: {{ message }}</div> <button @click="changeMessage">修改message</button> <showInfo name="why" :age="18" @info-btn-click="info 阅读全文
posted @ 2022-08-24 17:26 杨建鑫 阅读(43) 评论(0) 推荐(0) 编辑
摘要:<template> <div> <h2>当前计数: {{ counter }}</h2> <button @click="counter++">+1</button> <button @click="name = 'kobe'">修改name</button> </div> </template> 阅读全文
posted @ 2022-08-24 16:11 杨建鑫 阅读(43) 评论(0) 推荐(0) 编辑
摘要:<template> <div> 本人 : {{reactiveWatch.name}} - {{reactiveWatch.age}} 朋友 : {{reactiveWatch.firend.name}} 同桌 : {{reactiveWatch.firend.hang.name1}} - {{r 阅读全文
posted @ 2022-08-24 15:53 杨建鑫 阅读(29) 评论(0) 推荐(0) 编辑
摘要:<template> <div> 本人 : {{refWatch.name}} - {{refWatch.age}} 朋友 : {{refWatch.firend.name}} 同桌 : {{refWatch.firend.hang.name1}} - {{refWatch.firend.hang. 阅读全文
posted @ 2022-08-24 15:51 杨建鑫 阅读(248) 评论(0) 推荐(0) 编辑
摘要:<template> <div> {{refWatch}} <button @click="refWatch++">ref的变化</button> </div> </template> <script> import {ref,reactive,watch} from 'vue' export de 阅读全文
posted @ 2022-08-24 15:43 杨建鑫 阅读(282) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div>AppContent: {{ name }}</div> <button @click="name = 'kobe'">app btn</button> <show-info></show-info> </template> <script> import 阅读全文
posted @ 2022-08-24 15:04 杨建鑫 阅读(16) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div> <div class="name" ref="oneRef"> ref第一个 </div> <div class="name" ref="twoRef"> ref第2个 </div> <hello ref="ziRef"></hello> </div> 阅读全文
posted @ 2022-08-24 14:50 杨建鑫 阅读(165) 评论(0) 推荐(0) 编辑
摘要:<template> <div> <input type="number" v-model="num1"> + <input type="number" v-model="num2"> 答案 : {{total}} <hr> <input type="text" v-model="name1"> < 阅读全文
posted @ 2022-08-24 14:10 杨建鑫 阅读(21) 评论(0) 推荐(0) 编辑
摘要:<template> <div> 默认 : {{data.name}} - {{data.age}} - {{data.hight}} <br> 解构 : {{name}} - {{age}} - {{hight}} <br> <button @click="age++,hight++">改变</b 阅读全文
posted @ 2022-08-24 13:30 杨建鑫 阅读(68) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div> 父组件 : {{data.name}} - {{data.age}} - {{data.hight}} <hr> <Hello :data="data" :readonlyData="readonlyData" @readonlyChange="read 阅读全文
posted @ 2022-08-24 11:50 杨建鑫 阅读(23) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div> 父组件 : {{data.name}} - {{data.age}} - {{data.hight}} <hr> <Hello :data="data"></Hello> </div> </template> <script> import Hello 阅读全文
posted @ 2022-08-24 11:42 杨建鑫 阅读(13) 评论(0) 推荐(0) 编辑
摘要:<template> <div> <h1>浅层解包</h1> {{ageobj.age.value}} {{ageobj.age}} <button @click="ageobj.age.value++ ">修改浅层解包的年龄</button> </div> </template> <script> 阅读全文
posted @ 2022-08-24 10:26 杨建鑫 阅读(65) 评论(0) 推荐(0) 编辑
摘要:<template> <div> <h1>vue3</h1> <span>{{name}} - {{age}}</span> <button @click="refname">函数修改name</button> <button @click="name = '刚'">直接修改name</button 阅读全文
posted @ 2022-08-24 10:18 杨建鑫 阅读(57) 评论(0) 推荐(0) 编辑
摘要:<template> <div> <h1>vue3</h1> <span>{{info.name}} - {{info.age}}</span> <button @click="infobtn">修改info</button> </div> </template> <script> import { 阅读全文
posted @ 2022-08-24 09:54 杨建鑫 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-23 17:32 杨建鑫 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-23 15:21 杨建鑫 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-23 14:59 杨建鑫 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-23 14:38 杨建鑫 阅读(11) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <!-- 1.组件的v-model: 默认modelValue --> <counter v-model="appCounter"></counter> <!-- 上面的相当于下面的 --> <counter :modelValu 阅读全文
posted @ 2022-08-23 09:55 杨建鑫 阅读(21) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <div class="view"> <!-- include: 组件的名称来自于组件定义时name选项 --> <keep-alive include="home,about"> <component :is="currentT 阅读全文
posted @ 2022-08-23 09:43 杨建鑫 阅读(47) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <!-- 动态组件 component --> <!-- is中的组件需要来自两个地方: 1.全局注册的组件 2.局部注册的组件 --> <!-- <component :is="tabs[currentIndex]"></com 阅读全文
posted @ 2022-08-23 09:38 杨建鑫 阅读(45) 评论(0) 推荐(0) 编辑
摘要:<template> <div class="app"> <h2 ref="title" class="title" :style="{ color: titleColor }">{{ message }}</h2> <button ref="btn" @click="changeTitle">修改 阅读全文
posted @ 2022-08-23 09:32 杨建鑫 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1.引入库 在 src/until/event-bus.js import { HYEventBus } from 'hy-event-store' const eventBus = new HYEventBus() export default eventBus 2. 使用 1.发送 <templ 阅读全文
posted @ 2022-08-23 09:24 杨建鑫 阅读(62) 评论(0) 推荐(0) 编辑
摘要:祖先 : <template> <div class="app"> <home></home> <h2>App: {{ message }}</h2> <button @click="message = 'hello world'">修改message</button> </div> </templ 阅读全文
posted @ 2022-08-23 09:15 杨建鑫 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-22 15:00 杨建鑫 阅读(17) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <tab-control :titles="['衣服', '鞋子', '裤子']" @tab-item-click="tabItemClick"> <template v-slot="props"> <button>{{ prop 阅读全文
posted @ 2022-08-22 14:39 杨建鑫 阅读(19) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <!-- nav-bar只给一个插槽动态传入数据 --> <nav-bar> <template v-slot:[position]> <a href="#">注册</a> </template> </nav-bar> <button @click=" positi 阅读全文
posted @ 2022-08-22 14:31 杨建鑫 阅读(23) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <nav-bar> <template #left> <button>{{ leftText }}</button> </template> <template #center> <span>内容</span> </template> <template v-slo 阅读全文
posted @ 2022-08-22 14:27 杨建鑫 阅读(17) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <!-- 1.内容是button --> <show-message title="哈哈哈"> <button>我是按钮元素</button> </show-message> <!-- 2.内容是超链接 --> <show-mes 阅读全文
posted @ 2022-08-22 14:24 杨建鑫 阅读(14) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 1.自定义add-counter, 并且监听内部的add事件 --> <add-counter @add="addBtnClick"></add-counter> 阅读全文
posted @ 2022-08-22 14:20 杨建鑫 阅读(104) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 并且监听内部的sub事件 --> <sub-counter @sub="subBtnClick"></sub-counter> </div> </template 阅读全文
posted @ 2022-08-22 14:17 杨建鑫 阅读(11) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <!-- 如果当前的属性是一个非prop的attribute, 那么该属性会默认添加到子组件的根元素上 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class= 阅读全文
posted @ 2022-08-22 12:01 杨建鑫 阅读(36) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" /> </template> <script> import ShowInfo from './ShowInfo.vue' ex 阅读全文
posted @ 2022-08-22 11:46 杨建鑫 阅读(66) 评论(0) 推荐(0) 编辑
摘要:父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class="active" /> </template> <script> i 阅读全文
posted @ 2022-08-22 11:37 杨建鑫 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-19 16:07 杨建鑫 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-19 11:57 杨建鑫 阅读(5) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <home-nav></home-nav> <product-item></product-item> <product-item></product-item> <product-item></product-item> </div> <template 阅读全文
posted @ 2022-08-17 14:53 杨建鑫 阅读(19) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <!-- <home-nav></home-nav> --> <HomeNav></HomeNav> <home-nav></home-nav> <product-item></product-item> <product-item></product-i 阅读全文
posted @ 2022-08-17 14:51 杨建鑫 阅读(19) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <!-- select的单选 --> <select v-model="fruit"> <option value="apple">苹果</option> <option value="orange">橘子</option> <option value=" 阅读全文
posted @ 2022-08-17 14:45 杨建鑫 阅读(100) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <div class="gender"> <label for="male"> <input id="male" type="radio" v-model="gender" value="male"> 男 </label> <label for="fema 阅读全文
posted @ 2022-08-17 14:43 杨建鑫 阅读(40) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <!-- 1.checkbox单选框: 绑定到属性中的值是一个Boolean --> <label for="agree"> <input id="agree" type="checkbox" v-model="isAgree"> 同意协议 </label 阅读全文
posted @ 2022-08-17 14:42 杨建鑫 阅读(79) 评论(0) 推荐(0) 编辑
摘要:created() { this.$watch("message", (newValue, oldValue) => { console.log("message数据变化:", newValue, oldValue) }, { deep: true }) } 阅读全文
posted @ 2022-08-16 18:26 杨建鑫 阅读(13) 评论(0) 推荐(0) 编辑
摘要:watch: { // 默认watch监听不会进行深度监听 -- 简写模式 info(newValue, oldValue) { console.log("侦听到info改变:", newValue, oldValue) }, // 进行深度监听 -- 原始模式 info: { handler(ne 阅读全文
posted @ 2022-08-16 18:25 杨建鑫 阅读(106) 评论(0) 推荐(0) 编辑
摘要:// 完整的写法: fullname: { get: function() { return this.firstname + " " + this.lastname }, set: function(value) { const names = value.split(" ") this.firs 阅读全文
posted @ 2022-08-16 18:24 杨建鑫 阅读(45) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <!-- 1.普通的html写法 --> <h2 style="color: red; font-size: 30px;">哈哈哈哈</h2> <!-- 2.style中的某些值, 来自data中 --> <!-- 2.1.动态绑定style, 在后面跟上 阅读全文
posted @ 2022-08-16 14:50 杨建鑫 阅读(175) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <!-- 1.基本绑定class --> <h2 :class="classes">Hello World</h2> <!-- 2.动态class可以写对象语法 --> <button :class=" isActive ? 'active': '' " 阅读全文
posted @ 2022-08-16 14:49 杨建鑫 阅读(110) 评论(0) 推荐(0) 编辑
摘要:<body> <div id="app"> <div v-memo="[name, age]"> <h2>姓名: {{ name }}</h2> <h2>年龄: {{ age }}</h2> <h2>身高: {{ height }}</h2> </div> <button @click="updat 阅读全文
posted @ 2022-08-16 14:48 杨建鑫 阅读(25) 评论(0) 推荐(0) 编辑
摘要:一.邂逅版本控制工具 二.集中式和分布式的区别 三.Git的环境安装搭建 四.Git初始化本地仓库 五.GIt记录更新变化过程 六.Git远程仓库和验证 七.Git的标签tag用法 八.Git分支的使用过程 九.工作中的Git Flow 十.Git远程分支的管理 十一.Git rebase的使用 十 阅读全文
posted @ 2022-08-12 22:46 杨建鑫 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-11 16:19 杨建鑫 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-11 15:56 杨建鑫 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-08-09 17:14 杨建鑫 阅读(13) 评论(0) 推荐(0) 编辑
摘要:webpack中,有一些地方要用绝对路径的:地址 一.认识webpack工具 事实上随着前端的快速发展,目前前端的开发已经变的越来越复杂了: 比如开发过程中我们需要通过模块化的方式来开发; 比如也会使用一些高级的特性来加快我们的开发效率或者安全性,比如通过ES6+、TypeScript开发脚本逻辑, 阅读全文
posted @ 2022-08-09 12:04 杨建鑫 阅读(33) 评论(0) 推荐(0) 编辑
摘要:package配置文件(package.json) 如何生存 package.json ? npm init 就会问你 【怕麻烦就: npm init -y】 包的名字 :name 【必填属性】 版本号 : version 【必填属性】 描述 : descripttion 【必填属性】 配置入口 : 阅读全文
posted @ 2022-08-08 11:40 杨建鑫 阅读(1338) 评论(0) 推荐(0) 编辑
摘要:Node是什么? node是一个基于V8(JavaScript引擎) 的 JavaScript运行时环境 也就是说Node.js基于V8引擎来执行JavaScript的代码,但是不仅仅只有V8引擎: 前面我们知道V8可以嵌入到任何C ++应用程序中,无论是Chrome还是Node.js,事实上都是嵌 阅读全文
posted @ 2022-08-08 11:38 杨建鑫 阅读(24) 评论(0) 推荐(0) 编辑
摘要:JS模块化开发 1.认识模块化开发 事实上模块化开发最终的目的是将程序划分成一个个小的结构; 这个结构中编写属于自己的逻辑代码,有自己的作用域,定义变量名词时不会影响到其他的结构; 这个结构可以将自己希望暴露的变量、函数、对象等导出给其结构使用;[导出] 也可以通过某种方式,导入另外结构中的变量、函 阅读全文
posted @ 2022-08-07 23:10 杨建鑫 阅读(200) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示