Comparing version 0.0.21 to 0.0.22
@@ -145,3 +145,12 @@ # Home | ||
<FUIColumn header="Phone" sortable editable width="200" /> | ||
<FUIColumn header="Date of Birth" sortable editable type="date" :getter="toDate" :setter="fromDate" getter-on-edit width="200" /> | ||
<FUIColumn | ||
header="Date of Birth" | ||
sortable | ||
editable | ||
type="date" | ||
:getter="toDate" | ||
:setter="fromDate" | ||
getter-on-edit | ||
width="200" | ||
/> | ||
<FUIColumn header="Status" fixed="right" :options="statusOptions" editable width="200" /> | ||
@@ -160,3 +169,3 @@ </FUITable> | ||
const fromDate = (row, value) => { | ||
return row.dateOfBirth = value.split('-').reverse().join('.') | ||
return (row.dateOfBirth = value.split('-').reverse().join('.')) | ||
} | ||
@@ -188,3 +197,3 @@ | ||
status: '', // show placeholder | ||
} | ||
}, | ||
]) | ||
@@ -213,1 +222,35 @@ | ||
</FUITable> | ||
## useMountOutsidec() | ||
On some occasions you want to mount an element outside of the usual Vue app. This is useful for example when you want to open a modal programatically without the need to put it in the template and use Teleport. | ||
`useMountOutsidec()` gives you the ability to do so. | ||
It returns an function that mounts the specified component and returns an object with the `component` and an `unmount` function. | ||
`useMountOutside` takes 2 additional optional arguments: | ||
- `props` - an object with props that will be passed to the component | ||
- `children` - an array of children that will be passed to the component | ||
The mounting function can take an additional argument which will be passed to the component as additional props. | ||
```vue | ||
<template> | ||
<div> | ||
<button @click="openModal">Open Modal</button> | ||
</div> | ||
</template> | ||
<script setup> | ||
import { useMountOutsidec } from '../src/index' | ||
import Modal from './Modal.vue' | ||
const mountComponent = useMountOutsidec(Modal, props, children) | ||
const openModal = () => { | ||
const { component, unmoun } = mountComponent(extraProps) | ||
// do something with the component | ||
} | ||
</script> | ||
``` |
{ | ||
"name": "fuzzy-ui", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"main": "src/index.ts", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -7,1 +7,2 @@ export { default as FUITable } from './components/Table/Table.vue' | ||
export type { ColConfig, Row } from './components/Table/types' | ||
export * from './useMountOutside' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110625
40
349