Vue.js Learning Notes (5) ----------- Binding

Binding in both directions 1.v-model Bind data on the view to the Vue object. Design sketch:    Code: <div id="div1"> What do you call: <input type="text" v-model="name"/> <!--Get the value of name, and you can see that changing the text name in the text box above changes immediate ...

Posted by yanisdon on Sun, 05 Jan 2020 09:11:28 -0800

Vue element Multilingual Settings

In the project, you need to customize the Chinese / English switch. Based on vue.js, combined with vue-i18n and ElementUI, the following are the usage methods. ElementUI internationalization link: http://element-cn.eleme.io/#/... vue-i18n: https://github.com/kazupon/vu... Installation: npm install vue-i18n vue.js+vue-i18n int ...

Posted by Xo_ on Sun, 05 Jan 2020 06:41:50 -0800

Vue dynamic components and v-once instructions

1. Dynamic components Dynamic components can realize the switching between components. First, let's see an example of component switching display without dynamic components <div id="root"> <child-one v-if="type==='child-one'"></child-one> <child-two v-if="type==='child-two'"></child- ...

Posted by CiPH on Sun, 05 Jan 2020 02:22:36 -0800

Soul Torture: Do you know all the Vue template syntax?

Author| Jeskson Excavation| https://juejin.im/user/5a16e1f3f265da43128096cb The founder of Vue.js is Yuyuxi. In 2014, Vue.js was officially released, and in 2015, it was officially released as version 1.00.VUE.JS is a progressive JavaScript framework with declarative rendering, component systems, client routing, centralized state management, ...

Posted by kingconnections on Sat, 04 Jan 2020 08:44:26 -0800

Routing meta information instance

First look at the official website When defining routes, you can configure the meta field: const router = new VueRouter({ routes: [ { path: '/foo', component: Foo, children: [ { path: 'bar', component: Bar, // a meta field meta: { requiresAuth: true } } ...

Posted by jarcoal on Sat, 04 Jan 2020 00:00:34 -0800

Vue.js+axios get service

First of all, what Xiaguan said on the Internet Execute GET request // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); // Optionally the request above could also be done as axios.get( ...

Posted by nickholas on Fri, 03 Jan 2020 06:45:51 -0800

Route parameter passing of Vue router

params // client/config/routes.js export default [ { path: '/app/:id', } ] // client/app.vue <template> <div id="app"> <router-link to="/app/123">app</router-link> </div> </template> Click the app link to jump to the todo page, local url path localhost:8000/app/123 Get ...

Posted by macman90 on Fri, 03 Jan 2020 05:45:04 -0800

Detailed explanation of global registration and local registration of vue.js component

1. Global registration instance (according to the example on the official website, the following is the code) <div id="app"> <com-btn></com-btn> <com-btn></com-btn> </div> <script> Vue.component('com-btn',{ data:function(){ return{ ...

Posted by Vizionz on Thu, 02 Jan 2020 20:46:47 -0800

Rebuilding Vue kill editor: upload pictures to server and insert rich text

<template> <div> <quilleditor v-model="content" ref="myTextEditor" :options="editorOption" @change="onChange" > <div id="toolbar" slot="toolbar"> <select class="ql-size"> <option value="small">&l ...

Posted by bouba on Thu, 02 Jan 2020 13:14:03 -0800

Call Baidu map API input prompt sample drop-down list has been triggered

Look at the picture first. Then click OK. Actually, the drop-down box is triggered again. In addition, when you add various input boxes on the page, as long as you input text, the map drop-down box display will be triggered. It's a disgusting bug. I don't know if anyone has ever encountered it. From the code posted by Baidu api, I have mo ...

Posted by greenday on Wed, 01 Jan 2020 18:07:37 -0800