Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created Lesson04 #5

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"plugins": ["transform-runtime", ["component", [
{
"libraryName": "mint-ui",
"style": true
}
]]],
"env": {
"test": {
"presets": ["env", "stage-2"],
Expand Down
5 changes: 4 additions & 1 deletion build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ module.exports = {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src')
'@': resolve('src'),
'css': '@/modules/css',
'js': '@/modules/js',
'components': '@/components'
}
},
module: {
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.16.2",
"mint-ui": "^2.2.9",
"qs": "^6.5.0",
"swiper": "^3.4.2",
"velocity-animate": "^1.5.0",
"vue": "^2.3.3",
"vue-router": "^2.6.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-loader": "^7.1.1",
"babel-plugin-component": "^0.10.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
Expand All @@ -33,18 +39,18 @@
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"webpack-bundle-analyzer": "^2.2.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"opn": "^5.1.0",
"optimize-css-assets-webpack-plugin": "^2.0.0",
"ora": "^1.2.0",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"vue-loader": "^12.1.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.3.3",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.18.0",
"webpack-merge": "^4.1.0"
Expand Down
142 changes: 142 additions & 0 deletions src/components/Foot.vue

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions src/components/Swipe.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<template>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swp-page swiper-slide" v-for="list in lists">
<a class="js-no-follow" :href="list.clickUrl">
<img class="goods-main-photo fadeIn" :src="list.image">
</a>
</div>
</div>
<div class="swiper-pagination"></div>
</div>
</template>

<script>
// swiper对dom节点进行操作的,dom节点什么生成?mounted
import Swiper from 'swiper'
import 'swiper/dist/css/swiper.css'

export default {
// props: ['lists'],
props: {
lists: {
type: Array,
required: true
}
},
mounted() {
this.init()
},
methods: {
init() {
new Swiper('.swiper-container', {
loop: true,
pagination: '.swiper-pagination'
})
}
}
}
</script>

<style>
.swiper-slide img {
width: 100%;
height: 100%;
}
</style>
Loading