naive-ui/demo/header.vue

62 lines
1.0 KiB
Vue
Raw Normal View History

2019-09-17 19:28:28 +08:00
<template>
<div class="nav">
<div class="ui-logo">
2019-09-20 00:22:55 +08:00
NAIVE UI ({{ version }})
2019-09-17 19:28:28 +08:00
</div>
<div />
<div class="theme-picker">
<n-select
v-model="theme"
size="small"
:options="options"
@change="handleThemeChange"
/>
</div>
</div>
</template>
<script>
2019-09-20 00:22:55 +08:00
import { version } from '../package.json'
2019-09-17 19:28:28 +08:00
import withapp from '../packages/mixins/withapp'
export default {
mixins: [withapp],
data () {
return {
2019-09-20 00:22:55 +08:00
version,
2019-09-17 19:28:28 +08:00
theme: 'default',
options: [
{
label: 'dark',
value: 'default'
},
{
label: 'light',
value: 'light'
}
]
}
},
methods: {
handleThemeChange (theme) {
this.NApp.$parent.theme = theme
}
}
}
</script>
<style lang="scss" scoped>
.nav {
display: grid;
grid-template-columns: 272px 1fr 160px;
grid-template-rows: 64px;
align-items: center;
}
.ui-logo {
padding-left: 48px;
}
.theme-picker {
padding-right: 48px;
}
</style>