Commit 1d16a73d by tangqy

增加动画库

parent 3c7b19ad
...@@ -11,12 +11,14 @@ ...@@ -11,12 +11,14 @@
"build": "node build/build.js" "build": "node build/build.js"
}, },
"dependencies": { "dependencies": {
"animate.css": "^3.7.0",
"axios": "^0.18.0", "axios": "^0.18.0",
"echarts": "^4.2.0-rc.2", "echarts": "^4.2.0-rc.2",
"element-ui": "^2.4.9", "element-ui": "^2.4.9",
"moment": "^2.22.2", "moment": "^2.22.2",
"underscore": "^1.9.1", "underscore": "^1.9.1",
"v-charts": "^1.19.0", "v-charts": "^1.19.0",
"velocity-animate": "^1.5.0",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
</template> </template>
<script> <script>
// 引入mescroll的vue组件 // 引入mescroll的vue组件
import MescrollVue from '@/lib/mescroll/mescroll.vue' import MescrollVue from '@/lib/mescroll/mescroll.vue'
export default { export default {
name: 'message', name: 'message',
components: { components: {
MescrollVue MescrollVue
...@@ -100,11 +100,11 @@ ...@@ -100,11 +100,11 @@
* */ * */
async getListDataFromNet (pageNum, pageSize) { async getListDataFromNet (pageNum, pageSize) {
// 延时一秒,模拟联网 // 延时一秒,模拟联网
const res = await this.axios.get('http://rap2api.taobao.org/app/mock/115626/store/notice!getStoreNoticeListByPageAction.do',{ const res = await this.axios.get('http://rap2api.taobao.org/app/mock/115626/store/notice!getStoreNoticeListByPageAction.do', {
params:{ params: {
pageNo:pageNum, pageNo: pageNum,
pageSize, pageSize,
push_state:2 push_state: 2
} }
}) })
if (res.data.code === 0) { if (res.data.code === 0) {
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
} }
} }
} }
} }
</script> </script>
<style scope> <style scope>
......
...@@ -4,8 +4,10 @@ import Vue from 'vue' ...@@ -4,8 +4,10 @@ import Vue from 'vue'
import App from './App' import App from './App'
import router from './router' import router from './router'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import './assets/styles/reset.css' import './assets/styles/reset.css'
import './assets/styles/common.css' import './assets/styles/common.css'
import 'animate.css'
// import 'element-ui/lib/theme-chalk/index.css' // import 'element-ui/lib/theme-chalk/index.css'
import qs from 'qs' import qs from 'qs'
import store from './store' import store from './store'
...@@ -15,7 +17,7 @@ import * as filters from './filters' ...@@ -15,7 +17,7 @@ import * as filters from './filters'
import echarts from 'echarts' import echarts from 'echarts'
import VCharts from 'v-charts' import VCharts from 'v-charts'
import * as plugins from './plugin' import plugins from './plugin'
Vue.use(VCharts) Vue.use(VCharts)
Axios.defaults.withCredentials = true // 让ajax携带cookie Axios.defaults.withCredentials = true // 让ajax携带cookie
...@@ -40,7 +42,11 @@ Axios.interceptors.request.use( ...@@ -40,7 +42,11 @@ Axios.interceptors.request.use(
) )
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(plugins)
Object.keys(plugins).forEach(key => {
const plugin = plugins[key]
Vue.use(plugin)
})
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]) Vue.filter(key, filters[key])
......
import moment from './moment' import moment from './moment'
import underscore from './underscore' import underscore from './underscore'
export const momentPlugin = moment import velocity from './velocity'
export const underscorePlugin = underscore
export default {
moment,
underscore,
velocity
}
import velocity from 'velocity-animate'
import 'velocity-animate/velocity.ui'
class Animate {
install (Vue, options) {
// 4. 添加实例方法
Vue.prototype.$velocity = velocity
}
}
export default new Animate()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment