在看源代码时,发现codeigniter框架的控制器中,总是加上这样一段话: if(!defined('BASEPATH'))exit('No direct script access allowed');1刚接触codeigniter,一直没有领会它的作用,后来通过查资料发现其作用是: 为了防止跨站攻击,直接通过访问文件路径用的 另外要注意,这里定义的是:defined()而不是define(),如果你误将defined写成define,将会报一下错误: A PHP Error was enc
vue-router4 出现 No match found for location with path "/" #### router/index.ts文件 import { createRouter, RouteRecordRaw, createWebHashHistory } from 'vue-router' const routes: Array<RouteRecordRaw> = [ { path: '/', name: 'home', //这里的name co
Vue watchers allow to perform async updates as a side effect of a property change. This lesson shows you how you can watch properties on your class based component and how to use the @Watch decorator for it. <template> <div class="hello"
Vue models, v-model, allow us to use two-way data binding, which is useful in some cases such as forms. This lesson shows how to use it by creating a custom checkbox component using the @Model decorator in TypeScript. When using the v-model, the cust
Vue 2.2 introduced a simple dependency injection system, allowing you to use provide and inject in your component options. This lesson shows you how to use them using the @Inject and @Provide decorators in tandem! When you want to provide some servic
With properties we can follow a one-way parent→child flow communication between components. This lesson shows you how you can pass down properties to class based Vue components by using the @Prop decorator from vue-property-decorator. We’ll also see
Directives allow us to apply DOM manipulations as side effects. We’ll show you how you can create your own Vue directive to change a component’s colors and type-safe it with TypeScript. We’ll additionally show how you can pass objects to your directi
vue-router introduces new hooks into the component. In this lesson we’ll show you how to use these new hooks in your class based Vue components in TypeScript. We’ll also go over how we can create and use routes in Vue. Default component: <template>
Starter app: https://github.com/alexjoverm/Vue-Typescript-Starter Writing Vue components as plain objects has very limited capabilities for TypeScript’s IntelliSense. This lesson will show you how to write components as classes to take full potential