Skip to content

nicejade/vue-common-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Common Components

vue-common-components

Demo and instructions

Vue Component Desc And Demo | vue-components-doc@gitbook

Prepare the environment

// install/update nodejs (Version 4.0 and above)

git clone https://github.com/nicejade/vue-common-components
cd vue-common-components

//安装npm插件;(PS: 可自行更改 package.json 选择所需安装的插件[gulp系非必须])
npm install

//全局安装 webpack
npm install -g webpack

//运行demo示例(Example Document)
cd demo
webpack -w

Usage by importing components modules

<template lang='jade'>
    <count-down :time.sync="time" :is-complete-show-hms="isCompleteShowHms" :start.sync="isStartCount"></count-down>
    popup-toast
</template>

<script type="text/javascript">
import countDown from 'countDown'
import popupToast from 'popupToast'

export default {
    data () {
        return {
            isCompleteShowHms: true,
            time: 0,
            isStartCount: false,
        }
    },
    components: {
        countDown,
        popupToast,
    },
    methods: {
        onStartCountClick: function(){
            this.time = 9;
            this.isStartCount = true;
        },

        showPopupToast: function( text ){
            var toastMsg = {
                bodyText: text,
                timer: 2222,           //可不传;默认2000ms
                callBackFunc: null     // 可不传,默认null;
            }
            this.$broadcast('show-popup-toast', toastMsg);
        }
    },
    events: {
        'on-countdown-finish': function (countNum) {
            // callback of countdown finished(countNum)
            this.showPopupToast( "countdown had down; countNum = " + countNum )
        }
    }
}
</script>

<style media="screen">
.count-down-time{
    color: #fe0;
}
</style>

Additional recommendations

以上内容仅代表编写 README 时之前的经验心得;后续将持续学习,探究,更新。last modify:16-06-17 。

About

Simple and common Vue1.* components,It has been stopped maintenance long ago(!已停止维护).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published