Skip to content

Instantly share code, notes, and snippets.

@abelardolg
Created January 4, 2021 19:55
Show Gist options
  • Save abelardolg/ce86c8635db114b869efdb23963b0528 to your computer and use it in GitHub Desktop.
Save abelardolg/ce86c8635db114b869efdb23963b0528 to your computer and use it in GitHub Desktop.
[Vue warn]: Error in render: "TypeError: Cannot read property 'type' of undefined"
<template>
<div id="q-app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<template>
<q-page class="flex flex-center">
<div class="q-pa-md q-gutter-sm">
<q-editor v-model="editor" min-height="5rem"
@paste.native="evt => pasteCapture(evt)"
@drop.native="evt => dropCapture(evt)"
:definitions="{
bold:
{
label: 'Negrita', icon: null, tip: 'Negrita'
},
save:
{
tip: 'Save your work',
icon: 'save',
label: 'Guardar en tu equipo',
handler: saveWork
},
upload:
{
tip: 'Publicar en el servidor',
icon: 'cloud_upload',
label: 'Enviar al servidor',
handler: uploadIt
}
}"
:toolbar="[
[
{
label: $q.lang.editor.align,
icon: $q.iconSet.editor.align,
fixedLabel: true,
list: 'only-icons',
options: ['left', 'center', 'right', 'justify']
},
],
[
{
label: 'Formato',
icon: $q.iconSet.editor.bold,
fixedLabel: true,
list: 'only-icons',
options: ['bold', 'italic', 'strike', 'underline'],
}
],
[
{
label: 'Guardar',
icon: 'save',
fixedLabel: true,
list: 'only-icons',
options: ['upload', 'save']
}
],
[
{
label: 'Insertar',
icon: 'image',
fixedLabel: true,
list: 'only-icons',
options: ['picture']
}
]
]"
/>
<!-- <q-card flat bordered>-->
<!-- <q-card-section>-->
<!-- <pre style="white-space: pre-line">{{ editor }}</pre>-->
<!-- </q-card-section>-->
<!-- </q-card>-->
<!-- <q-card flat bordered>-->
<!-- <q-card-section v-html="editor" />-->
<!-- </q-card>-->
</div>
</q-page>
</template>
<script>
export default {
name: 'CrearRecurso',
data () {
return {
editor: 'What you see is <b>what</b> you get.'
}
},
methods: {
pasteCapture (evt) {
console.log('hola')
},
dropCapture (evt) {
console.log('hola')
},
saveWork () {
this.$q.notify({
message: 'Saved your text to local storage',
color: 'green-4',
textColor: 'white',
icon: 'cloud_done'
})
},
uploadIt () {
this.$q.notify({
message: 'Server unavailable. Check connectivity.',
color: 'red-5',
textColor: 'white',
icon: 'warning'
})
}
}
}
</script>
<style scoped>
</style>
{
"name": "hello-quasar",
"version": "0.0.1",
"description": "A Quasar Framework app",
"productName": "Quasar App",
"author": "abelardolg <[email protected]>",
"private": true,
"scripts": {
"lint": "eslint --ext .js,.vue ./",
"test": "echo \"No test specified\" && exit 0"
},
"dependencies": {
"@quasar/extras": "^1.0.0",
"core-js": "^3.6.5",
"quasar": "^1.0.0"
},
"devDependencies": {
"@quasar/app": "^2.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-loader": "^3.0.3",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.1.2"
},
"browserslist": [
"last 10 Chrome versions",
"last 10 Firefox versions",
"last 4 Edge versions",
"last 7 Safari versions",
"last 8 Android versions",
"last 8 ChromeAndroid versions",
"last 8 FirefoxAndroid versions",
"last 10 iOS versions",
"last 5 Opera versions"
],
"engines": {
"node": ">= 10.18.1",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment