随笔分类 - codewhy模块
摘要:<!--pages/06_learn_event/index.wxml--> <!-- 1.事件的基本使用 --> <button bindtap="onBtnTap">按钮</button> <!-- 2.event中target和currentTarget区别 --> <view id="out
阅读全文
摘要:第一步,创建wxs并导出 function formatPrice(price) { return "¥" + price } function calcPrice(books) { return "¥" + books.reduce(function(preValue, item) { retur
阅读全文
摘要:<!--pages/04_learn_wxml/index.wxml--> <h1>Mustache语法</h1> <view>{{ message }}</view> <view>{{ firstname + " " + lastname }}</view> <view>{{ date }}</v
阅读全文
摘要:<!--pages/03_learn_wxss/index.wxml--> <text>pages/03_learn_wxss/index.wxml</text> <!-- 1.样式的编写方式 --> <!-- 1.1.应用全局样式 --> <view class="title">learn wxs
阅读全文
摘要:// pages/profile/profile.js Page({ //数据 data: { avatarURL: "", listCount: 30 }, // 监听下拉刷新 onPullDownRefresh() { console.log("用户进行下拉刷新~"); // 模拟网络请求: 定
阅读全文
摘要:使用<template> import { defineStore } from 'pinia' // 用到其他store的信息 import useCounter from './counter' const useUser = defineStore('user',{ state:()=>({
阅读全文
摘要:使用 : <template> <div class="id"> <h3>姓名: {{ userStore.name }}</h3> <h3>年龄: {{ userStore.age }}</h3> <h3>等级: {{ userStore.level }}</h3> <h3>简化版姓名: {{ n
阅读全文
摘要:固定不变的 : stores/index.js import { createPinia } from "pinia" const pinia = createPinia() export default pinia main.js import { createApp } from 'vue' i
阅读全文
摘要:store/modules/home.js export default { state: { // 服务器数据 banners: [], recommends: [] }, mutations: { changeBanners(state, banners) { state.banners = b
阅读全文
摘要:<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
阅读全文
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h
阅读全文
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h
阅读全文
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h
阅读全文
摘要:<template> <div class="app"> 姓名:{{$store.state.nameVuex}} <button @click="btn">基本方法 : 修改名字</button> <br/> <button @click="btn1">传递值 : 修改名字</button> <h
阅读全文
摘要:app.vue <template> <div class="app"> <h3>在模板中直接使用(vue2-3都可用)</h3> 计算 : {{ $store.getters.counterGetter }} <br/> 年龄 : {{ $store.getters.usersAgesGetter
阅读全文
摘要:import { createStore } from 'vuex' export default createStore({ state: { nameVuex:'yjx', levelVuex:100, avtarURLVuex:'http', counterVuex:100, friends:
阅读全文

浙公网安备 33010602011771号