refactoring
This commit is contained in:
@@ -30,6 +30,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
ReactRenderer,
|
ReactRenderer,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
@@ -44,8 +45,8 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
content: null,
|
|
||||||
files: [],
|
files: [],
|
||||||
|
content: null,
|
||||||
currentIndex: 0,
|
currentIndex: 0,
|
||||||
syntax: {
|
syntax: {
|
||||||
js: 'javascript',
|
js: 'javascript',
|
||||||
@@ -58,7 +59,8 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
mainFile() {
|
mainFile() {
|
||||||
const file = this.files.find(item => item.path.endsWith('.vue') || item.path.endsWith('.jsx'))
|
const file = this.files
|
||||||
|
.find(item => item.path.endsWith('.vue') || item.path.endsWith('.jsx'))
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user