Skip to content

Commit ccdc8e6

Browse files
Only load markdown editor where needed (RecipeView)
Signed-off-by: Marcel Robitaille <[email protected]>
1 parent daaf7bd commit ccdc8e6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/components/RecipeView.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@
254254
</template>
255255

256256
<script>
257+
import Vue from "vue"
257258
import moment from "@nextcloud/moment"
259+
import VueShowdown from "vue-showdown"
258260
259261
import api from "cookbook/js/api-interface"
260262
import helpers from "cookbook/js/helper"
@@ -268,6 +270,13 @@ import RecipeNutritionInfoItem from "./RecipeNutritionInfoItem.vue"
268270
import RecipeTimer from "./RecipeTimer.vue"
269271
import RecipeTool from "./RecipeTool.vue"
270272
273+
// Markdown for Vue
274+
// Used by RecipeTool, RecipeInstruction, and RecipeIngredient
275+
Vue.use(VueShowdown, {
276+
// set default flavor for Markdown
277+
flavor: "vanilla",
278+
})
279+
271280
export default {
272281
name: "RecipeView",
273282
components: {

src/main.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77

88
// Markdown
9-
import VueShowdown from "vue-showdown"
10-
import moment from 'moment'
9+
import moment from "moment"
1110

1211
import { generateUrl } from "@nextcloud/router"
1312

@@ -56,12 +55,6 @@ if (__webpack_use_dev_server__ || false) {
5655
Vue.prototype.$window = window
5756
Vue.prototype.OC = OC
5857

59-
// Markdown for Vue
60-
Vue.use(VueShowdown, {
61-
// set default flavor for Markdown
62-
flavor: "vanilla",
63-
})
64-
6558
// Pass translation engine to Vue
6659
Vue.prototype.t = window.t
6760

0 commit comments

Comments
 (0)