Skip to content

Instantly share code, notes, and snippets.

@ianjennings
Last active June 25, 2020 02:12
Show Gist options
  • Save ianjennings/511883f5d455ba9d15ed220fe2ab935b to your computer and use it in GitHub Desktop.
Save ianjennings/511883f5d455ba9d15ed220fe2ab935b to your computer and use it in GitHub Desktop.

Code.exe > hello-world.page.js - paircast-sails - Visual Studio Code

08:10

Code.exe > ● hello-world.page.js - paircast-sails - Visual Studio Code

Wathc me doi it08:11

Commit 9d980eece71572129e74d5fdc847831b4662dbe8
--- assets/js/pages/hello-world.page.js
+++ assets/js/pages/hello-world.page.js
@@ -9,11 +9,14 @@ parasails.registerPage('hello-world', {
   //  ╦  ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦  ╔═╗
   //  ║  ║╠╣ ║╣ ║  ╚╦╝║  ║  ║╣
   //  ╩═╝╩╚  ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
-  beforeMount: function() {
+  beforeMount: function () {
     // Attach any initial data from the server.
     _.extend(this, SAILS_LOCALS);
   },
-  mounted: async function() {
+  mounted: async function () {
+
+    console.log(this.beta)
+
     //…
   },
 

08:17

It looks like we're lifting again.

08:19

In the middle of lifting their ego. So that's actually that line right there, So see Hello? Will Page 18 That's actually logging this stop Vita, and so that actually came from the back, and it's being rendered in the front within view.

08:20

chrome.exe > NEW_APP_NAME - Google Chrome

08:30

Code.exe > view-hello-world.js - paircast-sails - Visual Studio Code

08:33

And the cool thing is here is weakened and start playing with that in view.

08:40

Code.exe > hello-world.page.js - paircast-sails - Visual Studio Code

08:40

So if we take view Hello, world and we say we just say something like

08:45

Um

08:47

Ah H radicals. This Viane click equals beta giggles false.

08:50

Code.exe > ● hello-world.ejs - paircast-sails - Visual Studio Code

08:58

On. And of course we want, Teo.

09:02

Commit c09f04c5bf15d07b1df79335502e267ad1154749
--- views/pages/hello-world.ejs
+++ views/pages/hello-world.ejs
@@ -1,8 +1,6 @@
 <div id="hello-world" v-cloak>
 
   <h1>Hello World!</h1>
-  <p>(See also <em>assets/styles/pages/hello-world.less</em>, <em>assets/js/pages/hello-world.page.js</em>, and
-    <em>api/controllers/view-hello-world.js</em>.)</p>
-
+  <a href="#" v-on:click="beta == false">Set beta to false</a>
 </div>
 <%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>

09:05

Annihilate that in a false, illiterate sales. Ah, well, actually, you know what? We can't look. It sells local, so we'll what we'll do is we'll add a watcher, so I think it's a thing. It's a watch.

09:10

Code.exe > hello-world.ejs - paircast-sails - Visual Studio Code

09:17

In view, and we debate Ah.

09:20

Code.exe > ● hello-world.page.js - paircast-sails - Visual Studio Code

09:21

Function. Um, about Consul Log, updated.

09:29

Commit fc06d7017b4068ef982a40d78986b3f9bdfeabc5
--- assets/js/pages/hello-world.page.js
+++ assets/js/pages/hello-world.page.js
@@ -5,6 +5,11 @@ parasails.registerPage('hello-world', {
   data: {
     //…
   },
+  watch: {
+    beta: function () {
+      console.log('updated')
+    }
+  },
 
   //  ╦  ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦  ╔═╗
   //  ║  ║╠╣ ║╣ ║  ╚╦╝║  ║  ║╣

09:30

Code.exe > hello-world.page.js - paircast-sails - Visual Studio Code

09:30

Let's see what happens.

09:33

Looks like we're lifting again. Oh, it's a Watcher and view watch called watcher.

09:40

chrome.exe > vue watch - Google Search - Google Chrome

09:44

If you did.

09:46

Just look for a watch.

09:49

Watch. First name function, Peter.

09:50

chrome.exe > Computed Properties and Watchers — Vue.js - Google Chrome

09:52

Functioned well.

09:55

Commit ad86f44b609a37024606c12ff755423edcf1d601
--- assets/js/pages/hello-world.page.js
+++ assets/js/pages/hello-world.page.js
@@ -6,8 +6,8 @@ parasails.registerPage('hello-world', {
     //…
   },
   watch: {
-    beta: function () {
-      console.log('updated')
+    beta: function (val) {
+      console.log('updated', val)
     }
   },
 

09:56

Okay, let's see what happens now.

10:00

chrome.exe > NEW_APP_NAME - Google Chrome

10:02

Hello. We're Betas Not being updated. You know, I I would guess that has to do it The way I wrote, this is probably the bind.

10:10

Code.exe > ● hello-world.ejs - paircast-sails - Visual Studio Code

10:10

Commit 1dbf89bbd154aabb96957698ae093da820ae8ea3
--- views/pages/hello-world.ejs
+++ views/pages/hello-world.ejs
@@ -1,6 +1,6 @@
 <div id="hello-world" v-cloak>
 
   <h1>Hello World!</h1>
-  <a href="#" v-on:click="beta == false">Set beta to false</a>
+  <a href="#" v-bind:click="beta == false">Set beta to false</a>
 </div>
 <%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>

10:11

See if that works.

10:20

chrome.exe > NEW_APP_NAME - Google Chrome

10:30

chrome.exe > Computed Properties and Watchers — Vue.js - Google Chrome

10:30

Okay. Well, you know what? Let's just copy. Let's just look through the Ah watch example.

10:36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment