File tree 7 files changed +51
-14
lines changed
7 files changed +51
-14
lines changed Original file line number Diff line number Diff line change 1
- import { defineProps , h } from 'vue'
1
+ import type { PropType } from 'vue'
2
+ import { h } from 'vue'
2
3
import header from './header'
3
4
import main from './main'
4
5
import type { Podcast } from '~/models/Podcast'
@@ -8,7 +9,12 @@ interface Props {
8
9
}
9
10
10
11
export default {
11
- props : defineProps < Props > ( ) ,
12
+ props : {
13
+ podcast : {
14
+ type : Object as PropType < Podcast > ,
15
+ required : true ,
16
+ } ,
17
+ } ,
12
18
setup ( props : Props ) {
13
19
return h ( 'body' , [
14
20
header . setup ( { podcast : props . podcast } ) ,
Original file line number Diff line number Diff line change 1
- import { defineProps , h } from 'vue'
1
+ import { h } from 'vue'
2
2
3
3
interface Props {
4
4
title ?: string
5
5
css ?: string
6
6
}
7
7
8
8
export default {
9
- props : defineProps < Props > ( ) ,
9
+ props : {
10
+ title : {
11
+ type : String ,
12
+ required : false ,
13
+ } ,
14
+ css : {
15
+ type : String ,
16
+ required : false ,
17
+ } ,
18
+ } ,
10
19
setup ( props : Props ) {
11
20
return h ( 'head' , [
12
21
h ( 'meta' , {
Original file line number Diff line number Diff line change 1
- import { defineProps , h } from 'vue'
1
+ import type { PropType } from 'vue'
2
+ import { h } from 'vue'
2
3
import type { Podcast } from '~/models/Podcast'
3
4
4
5
interface Props {
5
6
podcast ?: Podcast
6
7
}
7
8
8
9
export default {
9
- props : defineProps < Props > ( ) ,
10
+ props : {
11
+ podcast : {
12
+ type : Object as PropType < Podcast > ,
13
+ required : true ,
14
+ } ,
15
+ } ,
10
16
setup ( props : Props ) {
11
17
const subscribe = {
12
18
en : 'Subscribe to podcast' ,
Original file line number Diff line number Diff line change 1
- import { defineProps , h } from 'vue'
1
+ import type { PropType } from 'vue'
2
+ import { h } from 'vue'
2
3
import head from './head'
3
4
import body from './body'
4
5
import type { Podcast } from '~/models/Podcast'
@@ -9,7 +10,16 @@ interface Props {
9
10
}
10
11
11
12
export default {
12
- props : defineProps < Props > ( ) ,
13
+ props : {
14
+ podcast : {
15
+ type : Object as PropType < Podcast > ,
16
+ required : true ,
17
+ } ,
18
+ css : {
19
+ type : String ,
20
+ required : false ,
21
+ } ,
22
+ } ,
13
23
setup ( props : Props ) {
14
24
return h ( 'html' , {
15
25
lang : props . podcast . language ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ interface Options {
11
11
}
12
12
}
13
13
14
- async function createDom ( options : Options ) : Promise < string > {
14
+ async function renderDom ( options : Options ) : Promise < string > {
15
15
const css = await readFile ( `${ cwd ( ) } /src/components/feed.css` , 'utf-8' )
16
16
options . props . css = css
17
17
@@ -21,5 +21,5 @@ async function createDom(options: Options): Promise<string> {
21
21
}
22
22
23
23
export {
24
- createDom ,
24
+ renderDom ,
25
25
}
Original file line number Diff line number Diff line change 1
- import { defineProps , h } from 'vue'
1
+ import type { PropType } from 'vue'
2
+ import { h } from 'vue'
2
3
import type { Podcast } from '~/models/Podcast'
3
4
4
5
interface Props {
5
6
podcast ?: Podcast
6
7
}
7
8
8
9
export default {
9
- props : defineProps < Props > ( ) ,
10
+ props : {
11
+ podcast : {
12
+ type : Object as PropType < Podcast > ,
13
+ required : true ,
14
+ } ,
15
+ } ,
10
16
setup ( props : Props ) {
11
17
const published = {
12
18
en : 'Published' ,
Original file line number Diff line number Diff line change 1
- import { createDom } from '../components'
1
+ import { renderDom } from '../components'
2
2
import type { Channel } from '../types'
3
3
import { Episode } from './Episode'
4
4
@@ -89,7 +89,7 @@ export class Podcast {
89
89
}
90
90
91
91
public async render ( ) : Promise < string > {
92
- return await createDom ( {
92
+ return await renderDom ( {
93
93
props : {
94
94
podcast : this ,
95
95
} ,
You can’t perform that action at this time.
0 commit comments