07 2018 档案
摘要:Router Scroll Position Restoration: remember and restore scroll position as the user navigates around an application. ShadowDOM v1 View Encapsulation:
阅读全文
摘要:JavaScript中有两种不同数据类型的值,分别是基本数据类型与引用数据类型 基本数据类型包含5类,分别是:Number、String、Boolean、Null、Undefined 引用数据类型包含剩下的Array、Date、Math、RegExp、Object、Function等 将一个值赋给变
阅读全文
摘要:Components with slots can expose their data by passing it into the slot and exposing the data using slot-scope in the template. This approach allows y
阅读全文
摘要:We have model like this: 1 package com.pluralsight.bookstore.model; 2 3 import javax.persistence.*; 4 import java.util.Date; 5 6 /** 7 * @author Anton
阅读全文
摘要:In this lesson, we will look at how to create variables and constants. These are containers that store data for later reference and/or retrieval. Dart
阅读全文
摘要:When you bring up the on screen keyboard in a mobile app, it will cover any text input or buttons on the bottom half of the screen, which can be frust
阅读全文
摘要:Mainly two things: 1. For all the creating and deleting opreations for the DB, we want to use 'REQUIRED' for the transaction. 2. For all the read only
阅读全文
摘要:You can dynamically switch between components in a template by using the reserved <component> element and dynamically bind to its is attribute. By usi
阅读全文
摘要:Because async components are not bundled with your app, they need to be loaded when requested. This means that your network could be slow, go down, or
阅读全文
摘要:Vue provides a straight-forward syntax for loading components at runtime to help shave off initial bundle size. You simply define a function that retu
阅读全文
摘要:A common scenario is to present different components based on the state of the application. Dynamic components in Vue make this simple by providing a
阅读全文
摘要:in client/app.js, we put user login logic inside here, so that other module can reuse those code by call: app.js: config.js: How to use in user page:
阅读全文
摘要:Render functions open up a world of customization and control by using pure JavaScript rather than Vue's templating language. When you need to pull of
阅读全文
摘要:Vue's functional components are small and flexible enough to be declared inside of .vue file next to the main component. This allows you to mix jsx an
阅读全文
摘要:Declaring templates and elements inside of templates works great for most scenarios. Sometimes you need a bit more control over what your component wi
阅读全文
摘要:Functional templates allow you to create components consisting of only the template tag and exposing the props passed into the template with the props
阅读全文
摘要:To bootsrap the application use the following Maven archetype: mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee
阅读全文
摘要:Vue's slots enable you to define where content of a component should land when you define the content inside of a parent component. You can also name
阅读全文
摘要:While traditional Vue components require a data function which returns an object and a method object with your handlers, vue-class-componentflattens c
阅读全文
摘要:While traditional Vue components require a data function which returns an object and a method object with your handlers, vue-class-componentflattens c
阅读全文
摘要:A Promise invokes a function which stores a value that will be passed to a callback. So when you wrap a Promise with an Observable, you'll always get
阅读全文
摘要:You most likely already have data or properties in your template which are controlled by third-party components or updated using data binding. You can
阅读全文
摘要:domStreams enable you to pass additional data along the stream that can be provided by the template (such as data coming from a v-forrendering of an A
阅读全文
摘要:Streams give you the power to handle a "pending" state where you've made a request for data, but the data hasn't yet returned. You can leverage this p
阅读全文
摘要:Splitting a stream into multiple streams causes new subscriptions. You can think of new subscriptions as "invoking a function". So if your original st
阅读全文
摘要:Wrapping the creation of an Observable inside of a Function allows you delay the creation of the Observable until it is needed. This becomes really im
阅读全文
摘要:When an image fails to load, it triggers an error event. You can capture the error event and merge it with your image loading stream to provide a back
阅读全文
摘要:You can map remote data directly into your Vue.js templates using RxJS. This lesson uses axios (and the vue-axios library which exposes axios on compo
阅读全文
摘要:The domStreams component property enables you to access Events from your Vue.js templates as Streams insides your subscriptions function. You can then
阅读全文
摘要:When you want to get the current value of a subject, you need to switch BehaviorSubject, it always emit the latest value or throw error. Then you can
阅读全文
摘要:1. Color Picker (Chrome) You might know how to use color picker in Chrome, recently there is a feature inside color picker which is "Contrast Ratio",
阅读全文
摘要:We can use Subject as Observable and Observer: // Subject should be only used to emit value for private // Using subject as an Observer const subject
阅读全文
摘要:Storybook is a UI component development environment for React, Vue, and Angular. With that, you can develop UI components without running your app. He
阅读全文
摘要:Prior odd: The idea is to take the odds for something happening (against it not happening), which we´ll write as prior odds. For example: The chances
阅读全文
摘要:Winston is a popular logging library for NodeJS which allows you to customise the output, as well as different logging targets. This lesson covers con
阅读全文
摘要:Github To stop having to change configuration settings in production code and to stop secure information like usernames and password being stored in s
阅读全文
摘要:DebounceTime: It's like delay, but passes only the most recent value from each burst of emissions. ThrottleTime: Lets a value pass, then ignores sourc
阅读全文
摘要:Take your end to end tests to the next level by comparing your current application's view with an already accepted screenshot. With the combination of
阅读全文
摘要:Often, we end up creating multiple unit tests for the same unit of code to make sure it behaves as expected with varied input. This is a good practice
阅读全文
摘要:Use can use colour and styles to make it easy to spot errors and group common functionality into blocks when viewing a NodeJS console. This lesson wil
阅读全文
摘要:Often times when developing web applications, you need to open multiple tabs to run different scripts to start the application. This can all be done w
阅读全文
摘要:Origianl article Protal from Angular CDK, is a way to create dynammic component. Consider an example of Page toolbar. This toolbar should show differe
阅读全文
摘要:We want to make sure that when we ship new code, our users can use the application. The best way we've found to do that is to write automated tests th
阅读全文
摘要:Sometime we want to set a default or fallback value when network request failed. Sometime we want to just throw the error again: You know about the fi
阅读全文
摘要:When we want to handle error observable in RxJS v6+, we can use 'retryWhen' and 'delayWhen':
阅读全文
摘要:We are able to cancel the fetch request by using AbortController with RxJS Observable.
阅读全文
摘要:exhaustMap: It drop the outter observable, just return the inner observable, and it waits until previous observable complete before emit next observab
阅读全文
摘要:With the right process in place, snapshot tests can be a great way to detect unintended changes in any part of your application that can be serialized
阅读全文
摘要:Integration tests let us keep our tests fast and reliable. They also allow us to test scenarios that are hard to recreate in a full end-to-end setup.
阅读全文
摘要:Inside one file, you can freely mark the number 1-9: And jump to Number of bookmark: It helps to generate type safe interface based the json file you
阅读全文
摘要:So each phone's width is 750rpx. And according to the device ratio (width:height), we can calucalate the height in rpx. For example iPhone 5: 320px x
阅读全文
摘要:Many applications have features that can be used with slight variations. Instead of maintaining multiple tests with nearly identical code, we can take
阅读全文
摘要:We’ll often need to access the same DOM elements multiple times in one test. Your first instinct might be to use cy.getand assign the result to a vari
阅读全文
摘要:We often only show UI elements as a result of some user interaction. Cypress detects visibility and by default won’t allow your test to interact with
阅读全文
摘要:By default, browsers load the assets in a render-blocking way. Modern browsers introduced prefetch and preload which let us specify the priority for a
阅读全文
摘要:By default, vue-router doesn’t lazy load the routes unless you tell it to do it. Lazy loading of the non-critical routes is one of the points of the P
阅读全文
摘要:Even if you have your application fully cached, you couldn’t perform any external request without internet connection. That’s why in order to build an
阅读全文
摘要:Service Workers get installed and activated in the background, but until we reload the page they don’t take full control in the app. Showing a notific
阅读全文