随笔分类 -  codewhy模块

摘要:使用 : 阅读全文
posted @ 2022-09-07 14:17 杨建鑫 阅读(28) 评论(0) 推荐(0)
摘要:使用 : 阅读全文
posted @ 2022-09-07 14:08 杨建鑫 阅读(18) 评论(0) 推荐(0)
摘要:<!--pages/06_learn_event/index.wxml--> <!-- 1.事件的基本使用 --> <button bindtap="onBtnTap">按钮</button> <!-- 2.event中target和currentTarget区别 --> <view id="out 阅读全文
posted @ 2022-09-07 13:52 杨建鑫 阅读(53) 评论(0) 推荐(0)
摘要:第一步,创建wxs并导出 function formatPrice(price) { return "¥" + price } function calcPrice(books) { return "¥" + books.reduce(function(preValue, item) { retur 阅读全文
posted @ 2022-09-07 13:40 杨建鑫 阅读(76) 评论(0) 推荐(0)
摘要:<!--pages/04_learn_wxml/index.wxml--> <h1>Mustache语法</h1> <view>{{ message }}</view> <view>{{ firstname + " " + lastname }}</view> <view>{{ date }}</v 阅读全文
posted @ 2022-09-07 13:33 杨建鑫 阅读(154) 评论(0) 推荐(0)
摘要:<!--pages/03_learn_wxss/index.wxml--> <text>pages/03_learn_wxss/index.wxml</text> <!-- 1.样式的编写方式 --> <!-- 1.1.应用全局样式 --> <view class="title">learn wxs 阅读全文
posted @ 2022-09-07 11:40 杨建鑫 阅读(47) 评论(0) 推荐(0)
摘要:// pages/profile/profile.js Page({ //数据 data: { avatarURL: "", listCount: 30 }, // 监听下拉刷新 onPullDownRefresh() { console.log("用户进行下拉刷新~"); // 模拟网络请求: 定 阅读全文
posted @ 2022-09-07 11:05 杨建鑫 阅读(38) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-09-07 10:56 杨建鑫 阅读(24) 评论(0) 推荐(0)
摘要:使用<template> import { defineStore } from 'pinia' // 用到其他store的信息 import useCounter from './counter' const useUser = defineStore('user',{ state:()=>({ 阅读全文
posted @ 2022-08-31 10:28 杨建鑫 阅读(657) 评论(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 杨建鑫 阅读(16) 评论(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 杨建鑫 阅读(77) 评论(0) 推荐(0)
摘要:store/modules/home.js export default { state: { // 服务器数据 banners: [], recommends: [] }, mutations: { changeBanners(state, banners) { state.banners = b 阅读全文
posted @ 2022-08-30 14:13 杨建鑫 阅读(86) 评论(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 杨建鑫 阅读(188) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-08-30 11:20 杨建鑫 阅读(20) 评论(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 杨建鑫 阅读(578) 评论(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 杨建鑫 阅读(589) 评论(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 杨建鑫 阅读(936) 评论(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 杨建鑫 阅读(246) 评论(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 杨建鑫 阅读(434) 评论(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 杨建鑫 阅读(1506) 评论(0) 推荐(0)