save
This commit is contained in:
4
cookbook/static/vue/css/chunk-vendors.css
Normal file
4
cookbook/static/vue/css/chunk-vendors.css
Normal file
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50;margin-top:60px}
|
File diff suppressed because one or more lines are too long
1
cookbook/static/vue/js/recipe_view.js
Normal file
1
cookbook/static/vue/js/recipe_view.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
(function(e){function t(t){for(var r,c,i=t[0],l=t[1],f=t[2],p=0,s=[];p<i.length;p++)c=i[p],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&s.push(o[c][0]),o[c]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);a&&a(t);while(s.length)s.shift()();return u.push.apply(u,f||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,i=1;i<n.length;i++){var l=n[i];0!==o[l]&&(r=!1)}r&&(u.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},o={util:0},u=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var f=0;f<i.length;f++)t(i[f]);var a=l;u.push([1,"chunk-vendors"]),n()})({"025e":function(e,t,n){"use strict";n.r(t),n.d(t,"myCustomTestFunction",(function(){return r}));n("e260"),n("e6cf"),n("cca6"),n("a79d");function r(e){console.log(e)}},1:function(e,t,n){e.exports=n("025e")}});
|
@ -1 +0,0 @@
|
||||
(function(e){function r(r){for(var n,c,l=r[0],a=r[1],p=r[2],f=0,s=[];f<l.length;f++)c=l[f],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&s.push(o[c][0]),o[c]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);i&&i(r);while(s.length)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var a=t[l];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=c(c.s=t[0]))}return e}var n={},o={vue_app_01:0},u=[];function c(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,c),t.l=!0,t.exports}c.m=e,c.c=n,c.d=function(e,r,t){c.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,r){if(1&r&&(e=c(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(c.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)c.d(t,n,function(r){return e[r]}.bind(null,n));return t},c.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(r,"a",r),r},c.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},c.p="";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],a=l.push.bind(l);l.push=r,l=l.slice();for(var p=0;p<l.length;p++)r(l[p]);var i=a;u.push([0,"chunk-vendors"]),t()})({0:function(e,r,t){e.exports=t("56d7")},"234a":function(e,r,t){},"56d7":function(e,r,t){"use strict";t.r(r);t("e260"),t("e6cf"),t("cca6"),t("a79d");var n=t("7a23");function o(e,r,t,o,u,c){var l=Object(n["e"])("HelloWorld");return Object(n["d"])(),Object(n["b"])(l,{msg:"Welcome to Your Vue.js App"})}var u={class:"hello"};function c(e,r,t,o,c,l){return Object(n["d"])(),Object(n["b"])("div",u,[Object(n["c"])("h1",null,Object(n["f"])(t.msg),1)])}var l={name:"HelloWorld",props:{msg:String}};l.render=c;var a=l,p={name:"App",components:{HelloWorld:a}};t("e825");p.render=o;var i=p;Object(n["a"])(i).mount("#app")},e825:function(e,r,t){"use strict";t("234a")}});
|
@ -28,12 +28,12 @@
|
||||
<div class="card border-primary">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col col-md-9">
|
||||
<div class="col col-md-8">
|
||||
<h4 class="card-title">{{ _('Ingredients') }}</h4>
|
||||
</div>
|
||||
<div class="col col-md-3">
|
||||
<div class="col col-md-4">
|
||||
<div class="input-group d-print-none">
|
||||
<input type="number" value="1" maxlength="3" class="form-control" style="min-width: 2vw"
|
||||
<input type="number" value="1" maxlength="3" class="form-control" style="min-width: 4vw;"
|
||||
v-model.number="servings"/>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fas fa-calculator"></i></span>
|
||||
|
@ -9,6 +9,13 @@ import Vue from 'vue'
|
||||
|
||||
import ScalableNumber from "@/components/ScalableNumber";
|
||||
|
||||
/*
|
||||
i dont 100% understand this kind of dirty workaround but it works ...
|
||||
If you read this and know a better way of running arbitrary vue code that comes from an API endpoint let me know
|
||||
|
||||
obviously only run trusted code this way ...
|
||||
*/
|
||||
|
||||
export default {
|
||||
name: 'CompileComponent',
|
||||
props: ['code', 'servings'],
|
||||
@ -23,10 +30,10 @@ export default {
|
||||
components: {
|
||||
ScalableNumber, // eslint-disable-line
|
||||
},
|
||||
template: `
|
||||
<div>${this.code}</div>`
|
||||
template: `<div>${this.code}</div>`
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -21,11 +21,8 @@
|
||||
|
||||
<div class="col-md-9">
|
||||
<i class="fas fa-paragraph text-secondary"></i>
|
||||
<span v-html="step.ingredients_markdown">
|
||||
|
||||
</span>
|
||||
|
||||
<compile-component :code="step.ingredients_markdown" :servings="servings"></compile-component>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -39,7 +36,6 @@ import {calculateAmount} from "@/utils/utils";
|
||||
|
||||
import Ingredient from "@/components/Ingredient";
|
||||
import {GettextMixin} from "@/utils/utils";
|
||||
import ScalableNumber from "@/components/ScalableNumber";
|
||||
|
||||
import CompileComponent from "@/components/CompileComponent";
|
||||
|
||||
@ -50,8 +46,7 @@ export default {
|
||||
],
|
||||
components: {
|
||||
Ingredient,
|
||||
CompileComponent, //eslint-disable-line
|
||||
ScalableNumber, // eslint-disable-line
|
||||
CompileComponent,
|
||||
},
|
||||
props: {
|
||||
step: Object,
|
||||
|
@ -1 +1 @@
|
||||
{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"recipe_view":[{"name":"js/recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"},{"name":"recipe_view.0cfcbd4a9e2e54391a69.hot-update.js","publicPath":"http://localhost:8080/recipe_view.0cfcbd4a9e2e54391a69.hot-update.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\recipe_view.0cfcbd4a9e2e54391a69.hot-update.js"}]},"error":"ModuleError","message":"Module Error (from ./node_modules/vue-loader/lib/loaders/templateLoader.js):\n(Emitted value instead of an instance of Error) \n\n Errors compiling template:\n\n Component template requires a root element, rather than just text.\n\n 1 | \n | \n 2 | {{ calculateAmount(number) }}\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n 3 | \n"}
|
||||
{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"recipe_view":[{"name":"js/recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"}]}}
|
Reference in New Issue
Block a user