Skip to content

Conversation

@YunYouJun
Copy link
Contributor

I'm sorry for my carelessness.

But I remember my configuration pasted from the document and it used to seem like 'extend'. I thought it might appear in changelog, but I didn't find it.

Perhaps typescript type tip is a better idea to use them as examples in a document.

Comment on lines 30 to 31
import { path } from '@vuepress/utils'
import { ThemeObject } from '@vuepress/core'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core should put before utils

Comment on lines 30 to 31
import { path } from '@vuepress/utils'
import { ThemeObject } from '@vuepress/core'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import type

Comment on lines 33 to 42
export default {
// 你的主题
name: 'vuepress-theme-foo',
// 要继承的父主题
extends: 'vuepress-theme-bar',
// 覆盖父主题的布局
layouts: {
Layout: path.resolve(__dirname, 'layouts/Layout.vue'),
},
} as ThemeObject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be consistent with the later snippet, i.e. const fooTheme ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

import type { ThemeObject } from '@vuepress/core'
import { path } from '@vuepress/utils'

const fooTheme = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const fooTheme: ThemeObject

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@meteorlxy meteorlxy changed the title docs(theme-default): add ts for extend-a-theme docs: add ts demo for extending-a-theme Aug 12, 2021
@meteorlxy meteorlxy merged commit e01d053 into vuepress:main Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants