The code of the Vue cli + mui area rolling instance, climui

Source: Internet
Author: User

The code of the Vue cli + mui area rolling instance, climui

Use vue cli + mui together to achieve the effect of region rolling. The method is as follows:

Step 1 introduce mui css js

@import url("/static/mui.min.css"); 

JS

import mui from '../../../static/mui.min.js'; 

Step 2

The area rolling structure of the write mui is like this.

<Div class = "mui-scroll-wrapper"> <div class = "mui-scroll"> * write the content to be rolled </div>

Paste a part of my code below

<Div class = "goods_foods mui-scroll-wrapper"> <div class = "mui-scroll"> <ul class = "mui-table-view"> <li v- = "item in goods"> 

Write JS below

<Script> import mui from '.. /.. /.. /static/mui. min. js 'const odd_ OK = 0; export default {props: {seller: {type: Object }}, data () {return {goods: [] }}, created () {this. $ http. get ("/api/goods "). then (response) => {response = response. body; if (response. errno === odd_ OK) {this. goods = response. data; this. $ nextTick () => {mui ('. mui-scroll-wrapper '). scroll ({deceleration: 0.0005 // flick deceleration Coefficient. The larger the coefficient, the slower the rolling speed and the smaller the rolling distance. The default value is 0.0006 });})}});},}; </script>

In this way, the vue cli + mui area is rolled.

The above example code of the Vue cli + mui area rolling is all the content that I have shared with you. I hope to give you a reference and support for the customer's house.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.