Skip to content

Commit

Permalink
feat: add test file and router
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Nov 13, 2020
1 parent 7dc787b commit fb6615c
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 37 deletions.
39 changes: 20 additions & 19 deletions packages/varlet-cli/site/pc/App.vue
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<template>
<div class="varlet-button">
<div class="varlet-button__text">
<div class="varlet-button__span--active">{{ count }}</div>
</div>
</div>
<div class="varlet-site">
<div class="varlet-site__header">
<input type="text" placeholder="" />
</div>
<router-view />
</div>
</template>

<script lang="ts">
import { ref, Ref, defineComponent } from 'vue'
export default defineComponent({
setup() {
const count: Ref<number> = ref(0)
return {
count
}
}
setup() {
const count: Ref<number> = ref(0)
return {
count,
}
},
})
</script>

<style lang="less">
.varlet {
&-button {
&__text {
}
&__span {
}
}
&-button {
&__text {
color: aqua;
}
&__span {
color: aqua;
}
}
}
</style>
26 changes: 13 additions & 13 deletions packages/varlet-cli/site/pc/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<meta content="<%= htmlWebpackPlugin.options.description %>" name="description" />
<link href="<%= htmlWebpackPlugin.options.logo %>" rel="icon" type="image/png" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" name="viewport" />
</head>
<body>
<div id="app"></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><%= htmlWebpackPlugin.options.title %></title>
<meta content="<%= htmlWebpackPlugin.options.description %>" name="description" />
<link href="<%= htmlWebpackPlugin.options.logo %>" rel="icon" type="image/png" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" name="viewport" />
</head>
<body>
<div id="app"></div>
</body>
</html>
8 changes: 7 additions & 1 deletion packages/varlet-cli/site/pc/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { createApp } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App.vue'
import routes from './routes'

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

const app = createApp(App as any)
app.mount('#app')
app.use(router).mount('#app')
4 changes: 4 additions & 0 deletions packages/varlet-cli/src/shims-md.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.md' {
const content: string
export default content
}
11 changes: 11 additions & 0 deletions packages/varlet-ui/src/docs/zh_CN/button.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# 这是 button

```javascript
import Vue from 'vue'
import { Button } from 'vant'

Vue.use(Button)
```

```javascript
let a = 3
```
31 changes: 27 additions & 4 deletions packages/varlet-ui/varlet.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
module.exports = {
namespace: 'varlet',
pc: {
title: 'Varlet 组件库',
description: 'Varlet 组件库文档',
title: 'Varlet 组件库示例',
description: 'Varlet 组件库示例',
logo: 'https://cn.vuejs.org/images/logo.png',
header: {
logo: 'https://cn.vuejs.org/images/logo.png',
search: {
zh_CN: '搜索文档...',
en_US: 'Search...',
},
i18nButton: {
zh_CN: 'En',
en_US: '中文',
},
},
menu: [
{
title: 'button',
doc: 'button',
text: {
zh_CN: '开发指南',
en_US: 'Essentials',
},
isTitle: true,
children: [
{
text: {
zh_CN: 'Button 按钮',
en_US: 'Button',
doc: 'button',
},
},
],
},
],
},
Expand Down

0 comments on commit fb6615c

Please sign in to comment.