Skip to content

Commit 7dd4ca8

Browse files
committed
fix example
1 parent 96dc235 commit 7dd4ca8

File tree

6 files changed

+60
-10
lines changed

6 files changed

+60
-10
lines changed

example/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# {{ name }}
2+
3+
> {{ description }}
4+
5+
## Build Setup
6+
7+
``` bash
8+
# install dependencies
9+
yarn install
10+
11+
# serve with hot reload at localhost:8080
12+
yarn dev
13+
14+
# build for sit env with minification
15+
yarn sit
16+
17+
# build for deploy env with minification
18+
yarn deploy
19+
20+
# build svg icon
21+
yarn svg
22+
```
23+
24+
## Cli Tool
25+
```
26+
yarn cli add [componentName] -t [componentType]
27+
```

example/src/common/responsive.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* mobile responsive
3+
*/
4+
5+
let designWidth = 750
6+
7+
!function () {
8+
let docEl = document.documentElement
9+
10+
let callback = function (e) {
11+
let min = Math.min(window.screen.height, window.screen.width)
12+
let scale = min / 750
13+
let viewport = `width=${designWidth},initial-scale=${scale},maximum-scale=${scale}, minimum-scale=${scale}`
14+
let meta = document.querySelector('meta[name="viewport"]')
15+
16+
if (!meta) {
17+
meta = document.createElement('meta')
18+
meta.setAttribute('name', 'viewport')
19+
document.querySelector('head').appendChild(meta)
20+
}
21+
meta.setAttribute('content', viewport)
22+
docEl.style.fontSize = designWidth / 10 + 'px'
23+
}
24+
25+
document.addEventListener('orientationchange', callback, false)
26+
document.addEventListener('resize', callback, false)
27+
document.addEventListener('DOMContentLoaded', callback, false)
28+
}()

example/src/components/views/product/list/list.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@
1313
</ul>
1414
</div>
1515
</template>
16-
<style src="./list.scss" lang="scss"></style>
17-
<!--<style lang="scss" module>
18-
.list {
19-
color: green;
20-
}
21-
</style>-->
16+
<style src="./list.scss" lang="scss" scoped></style>

example/src/components/views/todo/footer/footer.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
height: 40px;
1212
padding: 0 10px;
1313
font-size: 14px;
14-
justify-content: center;
14+
justify-content: space-between;
1515
align-items: center;
1616

1717
.filters {
1818
flex: 1;
1919
}
2020

2121
.clear {
22-
width: 100px;
22+
width: 110px;
23+
text-align: center;
2324
}
2425
}

example/src/components/views/todo/footer/footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="item-left">{{ remaining.length }} item left</div>
1010
<filters class="filters"></filters>
1111
<a class="clear" @click="clearComplete">
12-
<span v-show="completed.length > 0">clear complete</span>
12+
<span v-show="completed.length > 0">clear completed</span>
1313
</a>
1414
</div>
1515
</template>

example/src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import Vue from 'vue'
32
import App from 'components/pages/app'
43
import router from 'router'

0 commit comments

Comments
 (0)