Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the Linkage effect by combining vue with vant

Shulou Source: shulou.com Published: 2022-06-01 23:57:36 09月29日 Update

This article mainly shows you vue combined with vant how to achieve linkage effect, the content is easy to understand, clear, hope to help you solve doubts, the following let the editor to take you to study and learn "vue combined with vant how to achieve linkage effect" this article.

The details are as follows

1. Components used: Picker, Popup

2. Introduction: the correct introduction in main.js or the overall situation in the page; here, it is introduced on demand in main.js

Main.js

Import {Picker,Popup} from 'vant';Vue.use (Picker) .use (Popup)

Test.vue

Const citys = {'Zhejiang': [Hangzhou, Ningbo, Wenzhou, Jiaxing, Huzhou], Fujian: [Fuzhou, Xiamen, Putian, Sanming, Quanzhou]} Export default {name: 'login', data () {return {value:'', showPicker:false, columns: [{values: Object.keys (citys), className:' column1'} {values: citys ['Zhejiang'], className: 'column2', defaultIndex: 2}]} }, / / method collection methods: {onConfirm (value) {this.value = value [0] +'-'+ value [1]; this.showPicker = false;}, onChange (picker, values) {picker.setColumnValues (1, citys [values [0]]) }},}

Before using antd, after starting to use vant, I found a bad place. Antd introduces a component that will write all the components it involves, while vant only introduces the components to be introduced in this directory, which is not very convenient.

The above is about "how to achieve linkage effect between vue and vant". If this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.

Tags: Content components effects articles Zhejiang learning help yes overall situation just place friends that is new knowledge methods easy to understand more organization directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Information vpn OPPO Reno Shulou Technology