Skip to content

Commit

Permalink
Merge branch 'main' of github.com:haoziqaq/varlet into main
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Jan 28, 2021
2 parents 9e7a45b + 0b9d7e4 commit 3791159
Show file tree
Hide file tree
Showing 171 changed files with 6,652 additions and 6,430 deletions.
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"semi": false
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
}
},
"lint-staged": {
"*.{ts,tsx,js,vue,scss,less}": "prettier --write",
"*.{ts,tsx,js,vue,less}": "prettier --write",
"*.{ts,tsx,js,vue}": "eslint --fix",
"*.{vue,css,scss}": "stylelint --fix"
"*.{vue,css}": "stylelint --fix"
},
"eslintConfig": {
"root": true,
Expand Down
74 changes: 37 additions & 37 deletions packages/varlet-cli/site/mobile/App.vue
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
<template>
<div>
<header>{{ componentName }}</header>
<div class="router-view__block">
<router-view />
</div>
</div>
<div>
<header>{{ componentName }}</header>
<div class="router-view__block">
<router-view />
</div>
</div>
</template>

<script lang="ts">
export default {
data() {
return {
componentName: '',
}
},
watch: {
$route(this: any, to: any) {
const index = to.path.lastIndexOf('/')
const componentName = to.path.slice(index + 1).replace(/-([a-z])/g, (all: string, i: string) => i.toUpperCase())
this.componentName = componentName[0]?.toUpperCase() + componentName.slice(1)
},
},
data() {
return {
componentName: '',
}
},
watch: {
$route(this: any, to: any) {
const index = to.path.lastIndexOf('/')
const componentName = to.path.slice(index + 1).replace(/-([a-z])/g, (all: string, i: string) => i.toUpperCase())
this.componentName = componentName[0]?.toUpperCase() + componentName.slice(1)
},
},
}
</script>

<style>
body {
margin: 0;
padding: 0;
background: white;
min-height: 100%;
font-family: '微软雅黑 Light', sans-serif;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
margin: 0;
padding: 0;
background: white;
min-height: 100%;
font-family: '微软雅黑 Light', sans-serif;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
::-webkit-scrollbar {
display: none;
width: 0;
background: transparent;
display: none;
width: 0;
background: transparent;
}
header {
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 56px;
background-color: #fff;
font-weight: 500;
font-size: 18px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 56px;
background-color: #fff;
font-weight: 500;
font-size: 18px;
}
.router-view__block {
padding: 0 15px 30px;
padding: 0 15px 30px;
}
* {
box-sizing: border-box;
box-sizing: border-box;
}
</style>
14 changes: 7 additions & 7 deletions packages/varlet-cli/site/mobile/components/AppType.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<template>
<div class="app-type">
<slot />
</div>
<div class="app-type">
<slot />
</div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'AppType',
name: 'AppType',
})
</script>

<style lang="less">
.app-type {
padding: 12px 0;
color: #888;
font-size: 14px;
padding: 12px 0;
color: #888;
font-size: 14px;
}
</style>
4 changes: 2 additions & 2 deletions packages/varlet-cli/site/mobile/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import AppType from './components/AppType.vue'
import routes from './routes'

const router = createRouter({
history: createWebHashHistory(),
routes,
history: createWebHashHistory(),
routes,
})

const app = createApp(App as any)
Expand Down
Loading

0 comments on commit 3791159

Please sign in to comment.