Skip to content

Commit

Permalink
chore: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 16, 2025
1 parent 1da0e31 commit 27445a0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
5 changes: 1 addition & 4 deletions plugins/development/plugin-toc/src/client/components/Toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ export const Toc = defineComponent({
name: 'Toc',

props: {
headers: {
type: Array as PropType<TocPropsHeaders | undefined>,
default: undefined,
},
headers: Array as PropType<TocPropsHeaders | undefined>,

options: {
type: Object as PropType<Partial<TocPropsOptions>>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ export default defineComponent({
*
* @default current route base
*/
base: {
type: String,
default: '',
},
base: String,

/**
* Max level of catalog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ export const CodeTabs = defineComponent({
*
* 标签页 id
*/
tabId: {
type: String,
default: '',
},
tabId: String,
},

slots: Object as SlotsType<{
Expand Down Expand Up @@ -111,7 +108,7 @@ export const CodeTabs = defineComponent({
const getInitialIndex = (): number => {
if (props.tabId) {
const valueIndex = props.data.findIndex(
({ id }) => codeTabStore.value[props.tabId] === id,
({ id }) => codeTabStore.value[props.tabId!] === id,
)

if (valueIndex !== -1) return valueIndex
Expand All @@ -124,7 +121,7 @@ export const CodeTabs = defineComponent({
activeIndex.value = getInitialIndex()

watch(
() => codeTabStore.value[props.tabId],
() => props.tabId && codeTabStore.value[props.tabId],
(newValue, oldValue) => {
if (props.tabId && newValue !== oldValue) {
const index = props.data.findIndex(({ id }) => id === newValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export const Tabs = defineComponent({
*
* 标签页 id
*/
tabId: {
type: String,
default: '',
},
tabId: String,
},

slots: Object as SlotsType<{
Expand Down Expand Up @@ -112,7 +109,7 @@ export const Tabs = defineComponent({
const getInitialIndex = (): number => {
if (props.tabId) {
const valueIndex = props.data.findIndex(
({ id }) => tabStore.value[props.tabId] === id,
({ id }) => tabStore.value[props.tabId!] === id,
)

if (valueIndex !== -1) return valueIndex
Expand All @@ -125,7 +122,7 @@ export const Tabs = defineComponent({
activeIndex.value = getInitialIndex()

watch(
() => tabStore.value[props.tabId],
() => props.tabId && tabStore.value[props.tabId],
(newValue, oldValue) => {
if (props.tabId && newValue !== oldValue) {
const index = props.data.findIndex(({ id }) => id === newValue)
Expand Down
15 changes: 12 additions & 3 deletions plugins/markdown/plugin-revealjs/src/client/components/RevealJs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,30 @@ export const RevealJs = defineComponent({
*
* 幻灯片 id
*/
id: { type: String, required: true },
id: {
type: String,
required: true,
},

/**
* Presentation code
*
* 幻灯片代码
*/
code: { type: String, required: true },
code: {
type: String,
required: true,
},

/**
* Presentation theme
*
* 幻灯片主题
*/
theme: { type: String as PropType<RevealJsTheme>, default: 'auto' },
theme: {
type: String as PropType<RevealJsTheme>,
default: 'auto',
},
},

setup(props) {
Expand Down

0 comments on commit 27445a0

Please sign in to comment.