-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
魏银鹏
committed
Sep 13, 2018
1 parent
579bf3b
commit 9d84c1c
Showing
8 changed files
with
6,127 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# single-file-components vue单文件组件 | ||
`npm i` | ||
## webpack 配置已完成打包工作 | ||
`webpack` | ||
# webpack-dev-server可以用npm run dev打开 | ||
`npm run dev` | ||
为了引入方便 dev生成的/dist/main.js 和webpack build的main.js 放在一个文件夹。 | ||
dev生成的main.js 其实在内存中,不在文件中显示 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
<template> | ||
<div class="box"> | ||
<div class="desc">this is a single template component</div> | ||
<div class="container"> | ||
<div class="ab absolute1"></div> | ||
<div class="ab absolute2"></div> | ||
</div> | ||
</template> | ||
<script> | ||
import Vue from 'vue' | ||
export default { | ||
name:'cpui-demo', | ||
} | ||
</script> | ||
<style lang="less" scoped> | ||
.box{ | ||
.desc{ | ||
box-shadow: 1px solid red 10px; | ||
} | ||
} | ||
<style lang="less"> | ||
.container{ | ||
position: relative; | ||
color:blue; | ||
} | ||
.ab{ | ||
position:absolute; | ||
width: 100px; | ||
height:100px; | ||
top:0; | ||
left:0; | ||
} | ||
.absolute1{ | ||
left:60px; | ||
background: red; | ||
z-index: 1; | ||
} | ||
.absolute2{ | ||
background: yellow; | ||
z-index: 9; | ||
} | ||
</style> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Vue from 'vue' | ||
import App from './app' | ||
import App from './app.vue' | ||
new Vue({ | ||
el:'#app', | ||
render:h=>h(App) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
const {VueLoaderPlugin} = require('vue-loader') | ||
module.exports = { | ||
resolve:{ | ||
extensions:['.vue'] | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.vue$/, | ||
exclude: /(node_modules|bower_components)/, | ||
loader: 'vue-loader' | ||
} | ||
}, | ||
{ | ||
test: /\.less$/, | ||
exclude: /(node_modules|bower_components)/, | ||
use:[ | ||
'style-loader','css-loader', 'less-loader' | ||
] | ||
}, | ||
] | ||
} | ||
}, | ||
plugins:[ | ||
new VueLoaderPlugin() | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const merge = require('webpack-merge') | ||
const webpackBase = require('./webpack.config') | ||
const path = require('path'); | ||
|
||
module.exports = merge(webpackBase, { | ||
mode:'development', | ||
output:{ | ||
filename: 'dist/main.js', | ||
} | ||
}) |