From edeb57b8b1a40c6f4d1d275234afc2d70b1427be Mon Sep 17 00:00:00 2001 From: dtomlinson Date: Fri, 20 Mar 2020 03:50:54 +0000 Subject: [PATCH 1/2] removing old markdown notes --- links.md | 83 -------- notes.md | 456 ---------------------------------------- src/views/Untitled-5.md | 134 ------------ tutorial.md | 282 ------------------------- vuex.md | 43 ---- 5 files changed, 998 deletions(-) delete mode 100644 links.md delete mode 100644 notes.md delete mode 100644 src/views/Untitled-5.md delete mode 100644 tutorial.md delete mode 100644 vuex.md diff --git a/links.md b/links.md deleted file mode 100644 index 278fca7..0000000 --- a/links.md +++ /dev/null @@ -1,83 +0,0 @@ -# Vue resources/references - -## Javascript - -Babel ES2015 guide (good overview to JS) - - -## Interesting projects/things - -### Strapi - - - -Strapi is a opensource headless CMS. You can self-host and use it as an admin page to generate content. You can then write a front-end, and have it consume your Strapi endpoints to display content. - -A good tutorial to follow is: - - - -This will use Nuxt and Strapi to create a blog. - -### Pug - - - -Pug is a HTML templating engine that lets you write simplified HTML which it will render into full html. It has additional features, like loops/condititons/includes to do fancier stuff than with pure HTML. - -## Vuejs - -### General (vue) - -Awesome Vue - - -### Extensions - -Real time data-table editing in Vue: - - -Integrating a datetime into a datatable CRUD: - - -Vuetify CRUD datatables: - - -Loading bar component for top of page: - - - -### Tutorials/Guides (vue) - -Using AJAX and rate limiting with lodash: - - -### References - -Composition API in Vue3: - - -## Interesting designs - -### Sites - -- - -### Fonts - -- `Rene bieder campton` - -## Nuxt - -### General (nuxt) - - - -### Tutorials/Guides (nuxt) - - - -## Design - -Good free HQ images: - diff --git a/notes.md b/notes.md deleted file mode 100644 index 9fac101..0000000 --- a/notes.md +++ /dev/null @@ -1,456 +0,0 @@ -To Do: - -Organise Trilium with the Vue development - -- Have a note for tutorials -- Have a note for references (grouped by category) - -Once done with this, go through this and the auth0 tutorial and pick out any vue/javascript snippets into their own trilium note. - -Notes - -Vuetify - -Forms -https://vuetifyjs.com/en/components/forms - -To make a form you define a `v-model` of valid in the ``. `lazy-validation` will set this to true unless there are visible validation errors. - -`` - -The `v-form` component has three functions that can be access by setting a `ref` on the component. - -- this.\$refs.form.validate() -- this.\$refs.form.reset() -- this.\$refs.form.resetValidation() - -Validation is easy: https://vuetifyjs.com/en/components/forms/#usage - -Custom rules can be done: https://vuetifyjs.com/en/components/forms/#creating-rules - -When the `submit()` event is made, `this.$refs.form.validate()` will check the form. - -`v-model` is used to bind data 2 ways to the form and the data instance in vue. - -https://vuejs.org/v2/guide/forms.html - -`v-text-fields` are used to render inputs in a form. - -https://vuetifyjs.com/en/components/text-fields/ - -Using `:` before a prop means that the prop is dynamic and the value of it contains javascript. - -`:append-icon="passwordVisible ? 'visibility' : 'visibility_off'"` - -Here this is saying that `append-icon` takes a dynamic value. We are using the `? :` syntax - conditional ternary operator. This is short for a if then else. - -Available icons are (with `mdi-` prefix) https://materialdesignicons.com/ or https://material.io/resources/icons/?style=baseline - -Double bang notation - -The notation `!!variable` is double bang notation -https://medium.com/better-programming/javascript-bang-bang-i-shot-you-down-use-of-double-bangs-in-javascript-7c9d94446054 - -It returns the `variable` _truthy_ value. I.e if it's a string with a value it will be true. This is similar to doing `variable.__bool__` in python. - -When writing inputs you can create custom rules. - -For example: (in the `computed`) - -``` -passwordRules() { - return { - required: value => !!value || 'Required.', - min: v => v.length >= 8 || 'Min 8 characters', - emailMatch: () => ('The email and password you entered don\'t match'), - } -}, -``` - -For a ` - -``` - -The value of the field will be passed to the method `passwordRules()` and passed into the function inside it. This way, we can verify that the value exists (using double bang notation) and that it has a minimum length. - -Events on the input can be defined using the following syntax: -`@click:append="passwordVisible = !passwordVisible"` -This event (each event is documented in the Vuetify docs) will trigger when you click on the append icon you defined. - -You can write regex in javascript by placing it between two slash's. -They are useful with arrow notation to check if something matches a regex. -`v => /.+@.+/.test(v) || 'E-mail must be valid.'` - -Backtick strings is javascript's version of f-strings in python. You can then access variables with `${}` notation: - -``` -console.log( - `SIGN UP username: ${this.username}, password: ${this.password}, email: ${this.username}` - ) -``` - -You can write an if block like you would a function: - -```javascript -if (this.$refs.form.validate()) { -} -``` - -You can also follow this with an else (aligned with the end of the if block) - -```javascript -if (condition) { - // block of code to be executed if the condition is true -} else { - // block of code to be executed if the condition is false -} -``` - -You can also use the conditional ternary notation of -`condition ? true_action : false_action` - -Computed (properties and watchers) -https://stackoverflow.com/a/44350932 - -With computed you are creating getters/setters. You do this by writing the function in the `computed` directive. -Here we have written a computed property for `emailRules()` - we are using this function to check input on a form is correct. - -Computed properties don't take any arguments - but you can access the `data` scope through `$this.` if you need access to the data in the scope. - -They are better than using watchers/methods if you don't need the extra functionality. A good example is https://michaelnthiessen.com/most-important-feature-vue/ - -The main difference between `computed` and a `method` is that `computed` will cache automatically. It will only update, if the value updates. Everytime you call it it will use its cache. Expensive operations can be done this way. - -They are properties (like in Python). Computed properties will update whenever one of the values needed to make it is also updated. Whenever you want to filter or transform your data, you can use a Computed property. - -E.g if you have a list of names, and you want just those names that begin with 'b', you can write it as a computed property that returns this list. The stack overflow answer above demonstrates this. - -Remember: anything in `data` you can access in the `