Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion examples/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,9 @@ const router = createRouter({
});

const app = createApp(App);
app.use(ViewUIPlus);
app.use(ViewUIPlus, {
size: 'small'
});
app.use(router);
app.mount('#app');
export default app;
8 changes: 7 additions & 1 deletion src/components/page/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import Locale from '../../mixins/locale';

const prefixCls = 'ivu-page';
const sizes = ['small', 'default'];

export default {
name: 'Page',
Expand Down Expand Up @@ -117,8 +118,13 @@
}
},
size: {
type: String,
default () {
const global = getCurrentInstance().appContext.config.globalProperties;
return global.$VIEWUI && oneOf(global.$VIEWUI.size, sizes) ? global.$VIEWUI.size : 'default';
},
validator (value) {
return oneOf(value, ['small', 'default']);
return oneOf(value, sizes);
}
},
simple: {
Expand Down