হ্যালো লারাভেল ৫ । ৪
- Installation
- লারাভেল আড্ডা
- প্রধান কাঠামো বিন্যাস
- থিম / ফ্রন্ট এণ্ড সেটআপ
- ডাটাবেস আলাপ - (Database)
- রিলেশনশিপ
- কন্ট্রোলার - Controller
- রাউটিং - Routing
- কালেকশনস - Collections
- ইলোকোয়েন্ট ও আর এম (Eloquent ORM)
- Eloquent Model
- ফাইল সিস্টেম / স্টোরেজ
- লারাভেল ডাস্ক - Laravel Dusk
- ভ্যালিডেশনস (Validations)
- নেমস্পেস - Namespace
- MVC
ইলোকোয়েন্ট ও আর এম (Eloquent ORM)
Basics
Mixins are a flexible way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be “mixed” into the component’s own options.
Accessors & Mutators
Serialization
// define a component that uses this mixin
var Component = Vue.extend({
mixins: [myMixin]
})
var component = new Component() // -> “hello from mixin!”
Options that expect object values, for example methods
, components
and directives
, will be merged into the same object. The component’s options will take priority when there are conflicting keys in these objects:
|
Note that the same merge strategies are used in Vue.extend()
.
Global Mixin
You can also apply a mixin globally. Use caution! Once you apply a mixin globally, it will affect every Vue instance created afterwards. When used properly, this can be used to inject processing logic for custom options:
|
Use global mixins sparsely and carefully, because it affects every single Vue instance created, including third party components. In most cases, you should only use it for custom option handling like demonstrated in the example above. It’s also a good idea to ship them as Plugins to avoid duplicate application.
Custom Option Merge Strategies
When custom options are merged, they use the default strategy, which simply overwrites the existing value. If you want a custom option to be merged using custom logic, you need to attach a function to Vue.config.optionMergeStrategies
:
|
For most object-based options, you can simply use the same strategy used by methods
:
|
A more advanced example can be found on Vuex‘s 1.x merging strategy:
|