vue APIs
- createApp
- ref
- App
- Ref
- VNode
- defineComponent
- reactive
- watch
- computed
- onMounted
- inject
- onUnmounted
- h
- InjectionKey
- getCurrentInstance
- ComputedRef
- PropType
- Component
- nextTick
- watchEffect
- provide
- ComponentPublicInstance
- ComponentInternalInstance
- DirectiveBinding
- toRefs
- toRaw
- VueConstructor
- markRaw
- Plugin
- isRef
- onBeforeMount
- onBeforeUnmount
- readonly
- unref
- UnwrapRef
- createVNode
- shallowRef
- createSSRApp
- WatchStopHandle
- shallowReactive
- CSSProperties
- DeepReadonly
- toRef
- ExtractPropTypes
- WritableComputedRef
- render
- customRef
- ObjectDirective
- Directive
- CreateElement
- DefineComponent
- defineAsyncComponent
- ConcreteComponent
- effectScope
- EffectScope
- ComponentOptions
- SetupContext
- VueElement
- resolveComponent
- capitalize
- defineCustomElement
- triggerRef
- ComponentPropsOptions
- isVNode
- WatchOptions
- useCssModule
- Slots
- isReadonly
- onErrorCaptured
- ComponentObjectPropsOptions
- resolveDirective
- withDirectives
- Text
- queuePostFlushCb
- Fragment
- VNodeArrayChildren
- RenderFunction
- VNodeChild
- DirectiveOptions
- PluginFunction
- isReactive
- isProxy
- ButtonHTMLAttributes
- createTextVNode
- TeleportProps
- onDeactivated
- VNodeNormalizedChildren
Other Related APIs
vue#isReadonly TypeScript Examples
The following examples show how to use
vue#isReadonly.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: store.spec.ts From vue3-treeview with MIT License | 5 votes |
test("Expect to create store", () => {
const nodes = {
id1: {
text: "text1"
}
};
const config = {
roots: ["id1"]
};
const wrapper = mount({
template: "<div></div>",
props: ["nodes", "config"]
}, {
propsData: {
nodes,
config
}
});
const id = createState(wrapper.props() as any);
const state = states.get(id);
expect(isRef(state.nodes)).toBe(true);
expect(isReadonly(state.nodes)).toBe(true);
expect(state.nodes.value.id1).toMatchObject({text: "text1"});
expect(isRef(state.config)).toBe(true);
expect(isReadonly(state.config)).toBe(true);
expect(state.config.value).toMatchObject({roots:["id1"]});
expect(isRef(state.focusable)).toBe(true);
expect(state.focusable.value).toBeNull();
expect(isRef(state.dragged)).toBe(true);
expect(state.dragged.value).toMatchObject({
node: null,
element: null,
wrapper: null,
parentId: null
});
});