Skip to content

Commit b205292

Browse files
committed
fix: test code restricted only for R
1 parent 2cac55b commit b205292

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

components/content/Execute.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ export default {
4444
4545
setup(props) {
4646
const store = useCommandStore();
47-
47+
const route = useRoute();
48+
let lang = route.params.lang;
4849
var id = new Date().valueOf();
4950
id = "editorArea" + id;
5051
const { resultTestChanged } = storeToRefs(store);
5152
52-
return { store, id, resultTestChanged };
53+
return { store, id, resultTestChanged, lang };
5354
},
5455
data() {
5556
return {
@@ -72,8 +73,10 @@ export default {
7273
this.store.updateCommand(this.editor.getValue());
7374
},
7475
async testCode() {
75-
await this.store.updateCommand(this.editor.getValue());
76-
await this.store.updateCommandTest(this.test.split("\n"), this.id);
76+
if (this.lang == "r") {
77+
await this.store.updateCommand(this.editor.getValue());
78+
await this.store.updateCommandTest(this.test.split("\n"), this.id);
79+
}
7780
},
7881
},
7982
watch: {

0 commit comments

Comments
 (0)