chore(examples-nuxt): lint

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-04-20 16:29:44 +02:00
parent 20f9910793
commit 99866c7617
3 changed files with 15 additions and 6 deletions
+3
View File
@@ -1,3 +1,6 @@
module.exports = { module.exports = {
extends: ['@tooling/eslint-config'], extends: ['@tooling/eslint-config'],
rules: {
'no-console': 0,
},
} }
+10 -5
View File
@@ -37,8 +37,8 @@ const dark = ref(false)
* To update node properties you can simply use your elements v-model and mutate the elements directly * To update node properties you can simply use your elements v-model and mutate the elements directly
* Changes should always be reflected on the graph reactively, without the need to overwrite the elements * Changes should always be reflected on the graph reactively, without the need to overwrite the elements
*/ */
const updatePos = () => function updatePos() {
elements.value.forEach((el) => { return elements.value.forEach((el) => {
console.log(el, elements.value) console.log(el, elements.value)
if (isNode(el)) { if (isNode(el)) {
el.position = { el.position = {
@@ -47,18 +47,23 @@ const updatePos = () =>
} }
} }
}) })
}
/** /**
* toObject transforms your current graph data to an easily persist-able object * toObject transforms your current graph data to an easily persist-able object
*/ */
const logToObject = () => console.log(instance.value?.toObject()) function logToObject() {
return console.log(instance.value?.toObject())
}
/** /**
* Resets the current viewpane transformation (zoom & pan) * Resets the current viewpane transformation (zoom & pan)
*/ */
const resetTransform = () => instance.value?.setTransform({ x: 0, y: 0, zoom: 1 }) function resetTransform() {
return instance.value?.setTransform({ x: 0, y: 0, zoom: 1 })
}
const toggleClass = () => { function toggleClass() {
dark.value = !dark.value dark.value = !dark.value
elements.value.forEach((el) => (el.class = dark.value ? 'dark' : 'light')) elements.value.forEach((el) => (el.class = dark.value ? 'dark' : 'light'))
} }
+2 -1
View File
@@ -3,7 +3,8 @@
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "nuxt dev" "dev": "nuxt dev",
"lint": "eslint --ext .js,.ts,.vue ./"
}, },
"dependencies": { "dependencies": {
"@vue-flow/background": "workspace:*", "@vue-flow/background": "workspace:*",