File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
src/.vuepress/components/common Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <p class =" codepen" data-height =" 300" data-theme-id =" 39028" data-default-tab =" result" data-preview =" true" data-editable =" true"
3
+ :data-user =" user.slug"
4
+ :data-slug-hash =" slug"
5
+ :data-pen-title =" title" >
6
+ <span >Veja o exemplo <a :href =" `https://codepen.io/${user.slug}/pen/${slug}`" >
7
+ {{ title }}</a > por {{ user.name }} (<a :href =" `https://codepen.io/${user.slug}`" >@${user.slug}</a >)
8
+ no <a href =" https://codepen.io" >CodePen</a >.</span >
9
+ </p >
10
+ </template >
11
+
12
+ <script >
13
+ export default {
14
+ props: {
15
+ user: {
16
+ type: Object ,
17
+ default : () => ({
18
+ slug: ' vuejs-br' ,
19
+ name: ' Vue.js Brasil'
20
+ }),
21
+ },
22
+
23
+ title: {
24
+ type: String ,
25
+ default: null ,
26
+ },
27
+
28
+ slug: {
29
+ type: String ,
30
+ default: null ,
31
+ },
32
+ },
33
+ mounted () {
34
+ const codepenScript = document .createElement (' script' )
35
+ codepenScript .setAttribute (' src' , ' https://static.codepen.io/assets/embed/ei.js' )
36
+ codepenScript .async = true
37
+ this .$el .appendChild (codepenScript)
38
+ }
39
+ }
40
+ </script >
41
+
42
+ <style lang="scss">
43
+ .codepen {
44
+ box-sizing : border-box ;
45
+ height : 300px ;
46
+ display : flex ;
47
+ align-items : center ;
48
+ justify-content : center ;
49
+ border : 2px solid ;
50
+ margin : 1em 0 ;
51
+ padding : 1em ;
52
+ }
53
+ </style >
You can’t perform that action at this time.
0 commit comments