Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit be5a20b

Browse files
committed
to be continue
1 parent a8ab2fa commit be5a20b

File tree

11 files changed

+517
-2
lines changed

11 files changed

+517
-2
lines changed

‎.babelrc‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
["env", { "modules": false }],
4+
"stage-3"
5+
]
6+
}

‎.editorconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

‎README.md‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
# vue-ohyeah-scroll
2-
滚动条美化插件
1+
# vue-ohyeah
2+
3+
> A Vue.js project
4+
5+
## Build Setup
6+
7+
``` bash
8+
# install dependencies
9+
npm install
10+
11+
# serve with hot reload at localhost:8080
12+
npm run dev
13+
14+
# build for production with minification
15+
npm run build
16+
```
17+
18+
For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).

‎index.html‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>vue-ohyeah</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="/dist/build.js"></script>
10+
</body>
11+
</html>

‎package.json‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "vue-ohyeah",
3+
"description": "A Vue.js project",
4+
"version": "1.0.0",
5+
"author": "L <376693576@qq.com>",
6+
"license": "MIT",
7+
"private": false,
8+
"main": "dist/ohyeah-scroll.js",
9+
"scripts": {
10+
"dev": "cross-env NODE_ENV=development webpack-dev-server --hot",
11+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
12+
},
13+
"dependencies": {
14+
"vue": "^2.5.11"
15+
},
16+
"files": [
17+
"dist",
18+
"src"
19+
],
20+
"browserslist": [
21+
"> 1%",
22+
"last 2 versions",
23+
"not ie <= 8"
24+
],
25+
"devDependencies": {
26+
"babel-core": "^6.26.0",
27+
"babel-loader": "^7.1.2",
28+
"babel-preset-env": "^1.6.0",
29+
"babel-preset-stage-3": "^6.24.1",
30+
"cross-env": "^5.0.5",
31+
"css-loader": "^0.28.7",
32+
"file-loader": "^1.1.4",
33+
"node-sass": "^4.5.3",
34+
"sass-loader": "^6.0.6",
35+
"vue-loader": "^13.0.5",
36+
"vue-template-compiler": "^2.4.4",
37+
"webpack": "^3.6.0",
38+
"webpack-dev-server": "^2.9.1"
39+
}
40+
}

‎src/App.vue‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template>
2+
<div id="app">
3+
<p>a</p>
4+
<p>a</p>
5+
<div class="demo-div">
6+
<ohyeah-scroll>
7+
<ul>
8+
<li v-for="(item,index) in arr"
9+
:key="index">{{`${item}-${index}`}}</li>
10+
</ul>
11+
</ohyeah-scroll>
12+
</div>
13+
<button @click="add">add</button>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
name: "app",
20+
data() {
21+
return {
22+
msg: "Welcome to Your Vue.js App",
23+
arr: new Array(2).fill("a")
24+
};
25+
},
26+
methods: {
27+
add() {
28+
this.arr.push(this.arr.length + 1);
29+
}
30+
}
31+
};
32+
</script>
33+
<style lang="scss">
34+
body {
35+
padding: 0;
36+
margin: 0;
37+
background-color: #f0f0f0;
38+
}
39+
.demo-div {
40+
width: 300px;
41+
height: 500px;
42+
border: solid 1px #ccc;
43+
li {
44+
height: 100px;
45+
width: 800px;
46+
border: solid 1px #ccc;
47+
box-sizing: border-box;
48+
}
49+
}
50+
</style>

‎src/index.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import OhyeahScroll from './packages/ohyeah';
2+
3+
const install = function(Vue, opts = {}) {
4+
components.map(component => {
5+
Vue.component(component.name, component);
6+
});
7+
};
8+
9+
if (typeof window !== 'undefined' && window.Vue) {
10+
install(window.Vue);
11+
}
12+
13+
export default {
14+
install,
15+
OhyeahScroll,
16+
};

‎src/main.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Vue from 'vue';
2+
import App from './App.vue';
3+
4+
import OhyeahScroll from './packages/ohyeah';
5+
Vue.use(OhyeahScroll);
6+
7+
new Vue({
8+
el: '#app',
9+
render: h => h(App),
10+
});

‎src/packages/ohyeah/index.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import OhyeahScroll from './ohyeah';
2+
3+
OhyeahScroll.install = Vue => Vue.component(OhyeahScroll.name, OhyeahScroll);
4+
5+
export default OhyeahScroll;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /