最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Vue中給對(duì)象添加新屬性后界面不刷新的原理與解決方案詳解

 更新時(shí)間:2025年11月21日 09:00:23   作者:北辰alk  
這篇文章主要為大家詳細(xì)介紹了Vue中給對(duì)象添加新屬性后界面不刷新的原理與解決方案,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下

在 Vue.js 開(kāi)發(fā)中,很多開(kāi)發(fā)者都會(huì)遇到一個(gè)常見(jiàn)問(wèn)題:給響應(yīng)式對(duì)象添加新屬性時(shí),界面沒(méi)有自動(dòng)更新。這背后涉及 Vue 的響應(yīng)式系統(tǒng)原理。本文將深入探討這個(gè)問(wèn)題的原因,并提供完整的解決方案。

1. 問(wèn)題現(xiàn)象與重現(xiàn)

1.1 問(wèn)題演示

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue 響應(yīng)式問(wèn)題演示</title>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>用戶信息</h3>
        <p>姓名: {{ user.name }}</p>
        <p>年齡: {{ user.age }}</p>
        <!-- 新添加的屬性不會(huì)顯示 -->
        <p>郵箱: {{ user.email }}</p>
        
        <button @click="addProperty">添加郵箱屬性</button>
        <button @click="correctAddProperty">正確添加屬性</button>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                user: {
                    name: '張三',
                    age: 25
                }
            },
            methods: {
                // 錯(cuò)誤的方式 - 界面不會(huì)更新
                addProperty() {
                    this.user.email = 'zhangsan@example.com';
                    console.log('已添加郵箱:', this.user.email);
                    // 控制臺(tái)有數(shù)據(jù),但界面不更新!
                },
                
                // 正確的方式
                correctAddProperty() {
                    // 后面的章節(jié)會(huì)實(shí)現(xiàn)這個(gè)方法
                }
            }
        });
    </script>
</body>
</html>

1.2 問(wèn)題分析

運(yùn)行上述代碼,你會(huì)發(fā)現(xiàn):

  • 點(diǎn)擊"添加郵箱屬性"按鈕后,控制臺(tái)顯示數(shù)據(jù)已添加
  • 但頁(yè)面上的"郵箱"位置仍然顯示為空
  • 這就是典型的 Vue 響應(yīng)式失效問(wèn)題

2. Vue 響應(yīng)式原理深度解析

2.1 Vue 2.x 的響應(yīng)式實(shí)現(xiàn)

// 模擬 Vue 2.x 的響應(yīng)式原理
class SimpleVue {
    constructor(options) {
        this.$data = options.data();
        this.observe(this.$data);
    }
    
    observe(obj) {
        if (!obj || typeof obj !== 'object') return;
        
        Object.keys(obj).forEach(key => {
            this.defineReactive(obj, key, obj[key]);
        });
    }
    
    defineReactive(obj, key, val) {
        const dep = new Dep(); // 依賴收集器
        
        // 遞歸處理嵌套對(duì)象
        this.observe(val);
        
        Object.defineProperty(obj, key, {
            enumerable: true,
            configurable: true,
            get() {
                console.log(`讀取屬性 ${key}: ${val}`);
                // 這里會(huì)收集依賴
                if (Dep.target) {
                    dep.addSub(Dep.target);
                }
                return val;
            },
            set(newVal) {
                if (newVal === val) return;
                console.log(`設(shè)置屬性 ${key}: ${newVal}`);
                val = newVal;
                // 遞歸處理新值
                this.observe(newVal);
                // 通知更新
                dep.notify();
            }
        });
    }
}

// 依賴收集器
class Dep {
    constructor() {
        this.subs = [];
    }
    
    addSub(sub) {
        this.subs.push(sub);
    }
    
    notify() {
        this.subs.forEach(sub => sub.update());
    }
}

// 測(cè)試代碼
console.log('=== Vue 2 響應(yīng)式原理演示 ===');
const vm = new SimpleVue({
    data: () => ({
        user: {
            name: '李四',
            age: 30
        }
    })
});

console.log('初始狀態(tài):');
console.log(vm.$data.user.name); // 觸發(fā) getter

console.log('\n修改現(xiàn)有屬性:');
vm.$data.user.name = '王五'; // 觸發(fā) setter,可以通知更新

console.log('\n添加新屬性:');
vm.$data.user.email = 'new@example.com'; // 不會(huì)觸發(fā)任何響應(yīng)式機(jī)制
console.log('新屬性已添加,但無(wú)法響應(yīng)式更新:', vm.$data.user.email);

2.2 Object.defineProperty 的局限性

function demonstrateDefinePropertyLimitation() {
    const obj = {};
    let count = 0;
    
    // 初始化時(shí)定義屬性
    Object.defineProperty(obj, 'existingProp', {
        get() {
            console.log(`讀取 existingProp,計(jì)數(shù): ${++count}`);
            return obj._existingProp;
        },
        set(value) {
            console.log(`設(shè)置 existingProp 為: ${value}`);
            obj._existingProp = value;
        }
    });
    
    // 設(shè)置初始值
    obj.existingProp = '初始值';
    
    console.log('=== 測(cè)試現(xiàn)有屬性 ===');
    obj.existingProp = '新值'; // 會(huì)觸發(fā) setter
    
    console.log('\n=== 測(cè)試新增屬性 ===');
    // 直接添加新屬性
    obj.newProp = '新增的值'; // 不會(huì)觸發(fā)任何 getter/setter
    console.log('新屬性值:', obj.newProp); // 可以訪問(wèn),但沒(méi)有響應(yīng)式
    
    console.log('\n=== 使用 defineProperty 添加響應(yīng)式屬性 ===');
    Object.defineProperty(obj, 'newReactiveProp', {
        get() {
            console.log('讀取 newReactiveProp');
            return obj._newReactiveProp;
        },
        set(value) {
            console.log(`設(shè)置 newReactiveProp 為: ${value}`);
            obj._newReactiveProp = value;
        }
    });
    
    obj.newReactiveProp = '響應(yīng)式新值'; // 現(xiàn)在會(huì)觸發(fā) setter
}

demonstrateDefinePropertyLimitation();

3. 解決方案大全

3.1 Vue.set / this.$set (推薦)

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Vue.set 解決方案</title>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>Vue.set 方法演示</h3>
        <div>
            <p>用戶名: {{ user.name }}</p>
            <p>年齡: {{ user.age }}</p>
            <p v-if="user.email">郵箱: {{ user.email }}</p>
            <p v-if="user.address">地址: {{ user.address }}</p>
            <p v-if="user.hobbies">愛(ài)好: {{ user.hobbies.join(', ') }}</p>
        </div>
        
        <button @click="addEmail">添加郵箱 (Vue.set)</button>
        <button @click="addAddress">添加地址 (this.$set)</button>
        <button @click="addHobbies">添加愛(ài)好數(shù)組</button>
        <button @click="addNestedProperty">添加嵌套屬性</button>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                user: {
                    name: '張三',
                    age: 25,
                    profile: {
                        level: 1
                    }
                }
            },
            methods: {
                // 方法1: 使用 Vue.set 全局方法
                addEmail() {
                    Vue.set(this.user, 'email', 'zhangsan@example.com');
                    console.log('郵箱已添加:', this.user.email);
                },
                
                // 方法2: 使用 this.$set 實(shí)例方法 (推薦)
                addAddress() {
                    this.$set(this.user, 'address', '北京市朝陽(yáng)區(qū)');
                    console.log('地址已添加:', this.user.address);
                },
                
                // 方法3: 添加數(shù)組屬性
                addHobbies() {
                    this.$set(this.user, 'hobbies', ['閱讀', '游泳', '編程']);
                    console.log('愛(ài)好已添加:', this.user.hobbies);
                },
                
                // 方法4: 添加嵌套屬性
                addNestedProperty() {
                    this.$set(this.user.profile, 'score', 100);
                    console.log('嵌套屬性已添加:', this.user.profile.score);
                }
            }
        });
    </script>
</body>
</html>

3.2 Object.assign() 方法

// Object.assign 解決方案示例
function demonstrateObjectAssign() {
    const app = new Vue({
        el: '#app',
        data: {
            user: {
                name: '李四',
                age: 28
            }
        },
        methods: {
            updateWithAssign() {
                // 錯(cuò)誤方式:直接賦值
                // this.user = { ...this.user, email: 'lisi@example.com' };
                
                // 正確方式:使用 Object.assign 創(chuàng)建新對(duì)象
                this.user = Object.assign({}, this.user, {
                    email: 'lisi@example.com',
                    phone: '13800138000'
                });
                
                // 或者更簡(jiǎn)潔的寫(xiě)法
                // this.user = { ...this.user, ...{ email: 'lisi@example.com' } };
            },
            
            // 批量更新多個(gè)屬性
            batchUpdate() {
                const newProperties = {
                    company: '某科技有限公司',
                    position: '前端工程師',
                    salary: 20000
                };
                
                this.user = Object.assign({}, this.user, newProperties);
            }
        }
    });
}

console.log('=== Object.assign 原理說(shuō)明 ===');
const original = { a: 1, b: 2 };
console.log('原始對(duì)象:', original);

// Object.assign 返回一個(gè)新對(duì)象
const newObj = Object.assign({}, original, { c: 3, d: 4 });
console.log('新對(duì)象:', newObj);
console.log('原始對(duì)象不變:', original);
console.log('不是同一個(gè)對(duì)象:', original === newObj);

3.3 整體替換方案

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h3>整體替換方案</h3>
        <div>
            <p>商品名稱: {{ product.name }}</p>
            <p>價(jià)格: ¥{{ product.price }}</p>
            <p v-if="product.stock">庫(kù)存: {{ product.stock }}件</p>
            <p v-if="product.category">分類(lèi): {{ product.category }}</p>
        </div>
        
        <button @click="updateProduct">更新商品信息</button>
        <button @click="partialUpdate">部分更新</button>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                product: {
                    name: '筆記本電腦',
                    price: 5999
                }
            },
            methods: {
                // 整體替換
                updateProduct() {
                    this.product = {
                        name: this.product.name,
                        price: this.product.price,
                        stock: 100,
                        category: '電子產(chǎn)品',
                        brand: '某品牌'
                    };
                    console.log('商品信息已整體更新');
                },
                
                // 部分更新(擴(kuò)展運(yùn)算符)
                partialUpdate() {
                    this.product = {
                        ...this.product,
                        discount: 0.9,
                        tags: ['熱門(mén)', '新品']
                    };
                    console.log('商品信息已部分更新');
                }
            }
        });
    </script>
</body>
</html>

4. Vue 3 的響應(yīng)式改進(jìn)

4.1 Proxy-based 響應(yīng)式系統(tǒng)

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <h3>Vue 3 響應(yīng)式演示</h3>
        <div>
            <p>姓名: {{ user.name }}</p>
            <p>年齡: {{ user.age }}</p>
            <p v-if="user.email">郵箱: {{ user.email }}</p>
        </div>
        
        <button @click="addProperty">添加郵箱屬性</button>
        <button @click="addMultiple">添加多個(gè)屬性</button>
    </div>

    <script>
        const { createApp } = Vue;
        
        createApp({
            data() {
                return {
                    user: {
                        name: '王五',
                        age: 35
                    }
                }
            },
            methods: {
                // Vue 3 中可以直接添加屬性!
                addProperty() {
                    this.user.email = 'wangwu@example.com';
                    console.log('郵箱已添加:', this.user.email);
                    // 界面會(huì)自動(dòng)更新!
                },
                
                addMultiple() {
                    // 可以同時(shí)添加多個(gè)屬性
                    this.user.phone = '13900139000';
                    this.user.address = '上海市浦東新區(qū)';
                    this.user.hobbies = ['旅游', '攝影'];
                    
                    console.log('多個(gè)屬性已添加:', this.user);
                }
            }
        }).mount('#app');
    </script>
</body>
</html>

4.2 Vue 3 響應(yīng)式原理模擬

// Vue 3 Proxy 響應(yīng)式原理模擬
function createReactive(obj) {
    const handlers = {
        get(target, property, receiver) {
            console.log(`讀取屬性: ${property}`);
            const result = Reflect.get(target, property, receiver);
            // 如果是對(duì)象,遞歸代理
            if (result && typeof result === 'object') {
                return createReactive(result);
            }
            return result;
        },
        
        set(target, property, value, receiver) {
            console.log(`設(shè)置屬性: ${property} = ${value}`);
            const result = Reflect.set(target, property, value, receiver);
            // 這里可以觸發(fā)更新
            console.log('觸發(fā)界面更新!');
            return result;
        },
        
        deleteProperty(target, property) {
            console.log(`刪除屬性: ${property}`);
            const result = Reflect.deleteProperty(target, property);
            console.log('觸發(fā)界面更新!');
            return result;
        }
    };
    
    return new Proxy(obj, handlers);
}

// 測(cè)試 Vue 3 風(fēng)格的響應(yīng)式
console.log('=== Vue 3 Proxy 響應(yīng)式演示 ===');
const reactiveData = createReactive({
    name: '趙六',
    age: 40
});

console.log('\n--- 讀取現(xiàn)有屬性 ---');
console.log('姓名:', reactiveData.name);

console.log('\n--- 修改現(xiàn)有屬性 ---');
reactiveData.age = 41;

console.log('\n--- 添加新屬性 ---');
reactiveData.email = 'zhaoliu@example.com'; // 會(huì)觸發(fā) setter!

console.log('\n--- 刪除屬性 ---');
delete reactiveData.age; // 會(huì)觸發(fā) deleteProperty!

5. 實(shí)戰(zhàn)最佳實(shí)踐

5.1 響應(yīng)式數(shù)據(jù)設(shè)計(jì)模式

// 最佳實(shí)踐示例
class UserModel {
    constructor() {
        this.initUserData();
    }
    
    initUserData() {
        // 預(yù)先定義所有可能的數(shù)據(jù)結(jié)構(gòu)
        return {
            name: '',
            age: 0,
            email: '',
            phone: '',
            address: '',
            hobbies: [],
            profile: {
                avatar: '',
                level: 1,
                score: 0
            },
            // 預(yù)留擴(kuò)展字段
            extensions: {}
        };
    }
    
    // 安全的屬性添加方法
    safeAddProperty(vm, propertyPath, value) {
        const paths = propertyPath.split('.');
        let current = vm;
        
        for (let i = 0; i < paths.length - 1; i++) {
            if (!current[paths[i]]) {
                this.$set(current, paths[i], {});
            }
            current = current[paths[i]];
        }
        
        this.$set(current, paths[paths.length - 1], value);
    }
}

// 在 Vue 組件中的使用
const userModel = new UserModel();

new Vue({
    el: '#app',
    data: {
        // 使用完整的數(shù)據(jù)結(jié)構(gòu)初始化
        user: userModel.initUserData()
    },
    methods: {
        // 安全的更新方法
        updateUserProfile(updates) {
            Object.keys(updates).forEach(key => {
                this.$set(this.user, key, updates[key]);
            });
        },
        
        // 深度更新嵌套屬性
        updateNestedProperty(path, value) {
            userModel.safeAddProperty(this.user, path, value);
        }
    },
    
    mounted() {
        // 初始化數(shù)據(jù)
        this.user.name = '張三';
        this.user.age = 25;
        
        // 后續(xù)添加屬性
        this.updateUserProfile({
            email: 'zhangsan@example.com',
            phone: '13800138000'
        });
        
        // 添加嵌套屬性
        this.updateNestedProperty('profile.avatar', '/images/avatar.jpg');
    }
});

5.2 工具函數(shù)封裝

// 響應(yīng)式工具函數(shù)
const ReactiveUtils = {
    // 安全設(shè)置屬性
    safeSet: function(vm, obj, key, value) {
        if (vm && vm.$set) {
            vm.$set(obj, key, value);
        } else if (Vue && Vue.set) {
            Vue.set(obj, key, value);
        } else {
            console.warn('Vue.set 不可用,使用 Object.defineProperty');
            Object.defineProperty(obj, key, {
                value: value,
                enumerable: true,
                configurable: true,
                writable: true
            });
        }
    },
    
    // 批量設(shè)置屬性
    batchSet: function(vm, obj, properties) {
        Object.keys(properties).forEach(key => {
            this.safeSet(vm, obj, key, properties[key]);
        });
    },
    
    // 深度設(shè)置嵌套屬性
    deepSet: function(vm, obj, path, value) {
        const keys = path.split('.');
        let current = obj;
        
        for (let i = 0; i < keys.length - 1; i++) {
            const key = keys[i];
            if (!current[key] || typeof current[key] !== 'object') {
                this.safeSet(vm, current, key, {});
            }
            current = current[key];
        }
        
        const lastKey = keys[keys.length - 1];
        this.safeSet(vm, current, lastKey, value);
    }
};

// 使用示例
const app = new Vue({
    el: '#app',
    data: {
        complexData: {
            user: {
                basicInfo: {
                    name: '張三'
                }
            }
        }
    },
    methods: {
        initComplexData() {
            // 批量設(shè)置屬性
            ReactiveUtils.batchSet(this, this.complexData.user, {
                age: 25,
                email: 'test@example.com'
            });
            
            // 深度設(shè)置嵌套屬性
            ReactiveUtils.deepSet(this, this.complexData, 'user.basicInfo.avatar', '/avatar.jpg');
            ReactiveUtils.deepSet(this, this.complexData, 'user.settings.theme', 'dark');
        }
    }
});

6. 總結(jié)與選擇指南

6.1 解決方案對(duì)比

方法適用場(chǎng)景優(yōu)點(diǎn)缺點(diǎn)
Vue.set() / this.$set()添加單個(gè)新屬性精確控制,性能好多個(gè)屬性需要多次調(diào)用
Object.assign()批量更新屬性代碼簡(jiǎn)潔,批量操作創(chuàng)建新對(duì)象,可能丟失其他響應(yīng)式屬性
整體替換數(shù)據(jù)結(jié)構(gòu)變化大徹底避免響應(yīng)式問(wèn)題性能開(kāi)銷(xiāo)較大
預(yù)先定義已知完整數(shù)據(jù)結(jié)構(gòu)最佳性能,無(wú)后續(xù)問(wèn)題需要提前規(guī)劃數(shù)據(jù)結(jié)構(gòu)

6.2 選擇流程圖

6.3 最終建議

Vue 2 項(xiàng)目

  • 優(yōu)先使用 this.$set()
  • 批量更新使用 Object.assign()
  • 復(fù)雜數(shù)據(jù)結(jié)構(gòu)預(yù)先定義

Vue 3 項(xiàng)目

  • 直接賦值即可
  • 享受 Proxy 帶來(lái)的便利

通用建議

  • 在設(shè)計(jì)階段盡量明確數(shù)據(jù)結(jié)構(gòu)
  • 使用 TypeScript 提前定義接口
  • 封裝工具函數(shù)統(tǒng)一處理響應(yīng)式更新

記住,理解 Vue 響應(yīng)式原理比記住解決方案更重要。掌握了原理,你就能靈活應(yīng)對(duì)各種復(fù)雜的場(chǎng)景需求。

到此這篇關(guān)于Vue中給對(duì)象添加新屬性后界面不刷新的原理與解決方案詳解的文章就介紹到這了,更多相關(guān)Vue對(duì)象添加屬性后界面不刷新解決內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • vue在自定義組件中使用v-model進(jìn)行數(shù)據(jù)綁定的方法

    vue在自定義組件中使用v-model進(jìn)行數(shù)據(jù)綁定的方法

    這篇文章主要介紹了vue在自定義組件中使用v-model進(jìn)行數(shù)據(jù)綁定的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-03-03
  • 關(guān)于vue-router的那些事兒

    關(guān)于vue-router的那些事兒

    要學(xué)習(xí)vue-router就要先知道這里的路由是什么?為什么我們不能像原來(lái)一樣直接用標(biāo)簽編寫(xiě)鏈接哪?vue-router如何使用?常見(jiàn)路由操作有哪些?等等這些問(wèn)題,就是本篇要探討的主要問(wèn)題,感興趣的朋友跟隨腳本之家小編一起學(xué)習(xí)吧
    2018-05-05
  • 在Vue3項(xiàng)目中使用MQTT獲取數(shù)據(jù)的方法示例

    在Vue3項(xiàng)目中使用MQTT獲取數(shù)據(jù)的方法示例

    這篇文章主要介紹了在Vue3項(xiàng)目中使用MQTT.js庫(kù)實(shí)現(xiàn)數(shù)據(jù)獲取的步驟,包括安裝庫(kù)、創(chuàng)建MQTT連接、發(fā)送和接收消息、配置安全選項(xiàng)等,并提供了一個(gè)完整的示例代碼和常見(jiàn)問(wèn)題解決方法,需要的朋友可以參考下
    2025-11-11
  • vue3.0 搭建項(xiàng)目總結(jié)(詳細(xì)步驟)

    vue3.0 搭建項(xiàng)目總結(jié)(詳細(xì)步驟)

    這篇文章主要介紹了vue3.0 搭建項(xiàng)目總結(jié)(詳細(xì)步驟),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • element-ui中table表格的折疊和隱藏方式

    element-ui中table表格的折疊和隱藏方式

    這篇文章主要介紹了element-ui中table表格的折疊和隱藏方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • 關(guān)于vue中根據(jù)用戶權(quán)限動(dòng)態(tài)添加路由的問(wèn)題

    關(guān)于vue中根據(jù)用戶權(quán)限動(dòng)態(tài)添加路由的問(wèn)題

    每次路由發(fā)生變化時(shí)都需要調(diào)用一次路由守衛(wèi),并且store中的數(shù)據(jù)會(huì)在每次刷新的時(shí)候清空,因此需要判斷store中是否有添加的動(dòng)態(tài)路由,本文給大家分享vue中根據(jù)用戶權(quán)限動(dòng)態(tài)添加路由的問(wèn)題,感興趣的朋友一起看看吧
    2021-11-11
  • Vue自定義驗(yàn)證之日期時(shí)間選擇器詳解

    Vue自定義驗(yàn)證之日期時(shí)間選擇器詳解

    這篇文章主要介紹了Vue自定義驗(yàn)證之日期時(shí)間選擇器詳解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-02-02
  • Vue實(shí)現(xiàn)購(gòu)物小球拋物線的方法實(shí)例

    Vue實(shí)現(xiàn)購(gòu)物小球拋物線的方法實(shí)例

    這篇文章主要給大家介紹了Vue實(shí)現(xiàn)購(gòu)物小球拋物線的方法實(shí)例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-11-11
  • 前端vue2中直接拉起vnc客戶端實(shí)現(xiàn)方式

    前端vue2中直接拉起vnc客戶端實(shí)現(xiàn)方式

    本文介紹Vue項(xiàng)目中協(xié)議檢測(cè)工具類(lèi)與組件的實(shí)現(xiàn),通過(guò)封裝檢測(cè)邏輯提升復(fù)用性,并展示如何在組件中應(yīng)用工具類(lèi)進(jìn)行協(xié)議校驗(yàn)與數(shù)據(jù)展示
    2025-08-08
  • 如何手寫(xiě)一個(gè)簡(jiǎn)易的 Vuex

    如何手寫(xiě)一個(gè)簡(jiǎn)易的 Vuex

    這篇文章主要介紹了如何手寫(xiě)一個(gè)簡(jiǎn)易的 Vuex,幫助大家更好的理解和學(xué)習(xí)vue,感興趣的朋友可以了解下
    2020-10-10

最新評(píng)論

闵行区| 荣昌县| 忻城县| 监利县| 蒙自县| 衡阳市| 河间市| 吉林市| 湖南省| 舞阳县| 尤溪县| 浦县| 永靖县| 肥乡县| 马尔康县| 奉贤区| 河源市| 胶州市| 盐边县| 虎林市| 西乡县| 高邑县| 阿克苏市| 连南| 伊吾县| 新安县| 海门市| 南木林县| 桑日县| 新田县| 泰顺县| 阳城县| 天等县| 中西区| 井研县| 汽车| 施甸县| 桃源县| 柞水县| 珠海市| 赤峰市|