Skip to content

Commit

Permalink
docs: use property export for "useVuelidate" (vuelidate#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
dargmuesli authored Sep 12, 2022
1 parent 6f8be83 commit 791f698
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<script>
import { ref, reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, minLength, sameAs, helpers } from '@vuelidate/validators'
const { withMessage, withParams, unwrap } = helpers
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/.vitepress/theme/components/NestedA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<script>
import { ref, reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, maxValue } from '@vuelidate/validators'
import NestedB from './NestedB.vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/.vitepress/theme/components/NestedB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<script>
import { ref, reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, maxValue, minValue } from '@vuelidate/validators'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<script>
import { ref } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, minValue } from '@vuelidate/validators'
import NestedA from './NestedA.vue'
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can still define your validation rules as part of the Options API.
```vue
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { minLength, required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -172,7 +172,7 @@ cause performance issues in more complex scenarios. Refer to [Nested Validators]
<script>
// setup in a component
import { helpers, required } from '@vuelidate/validators'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { reactive } from 'vue'
export default {
Expand Down Expand Up @@ -279,7 +279,7 @@ the need for dedicated form components. This would allow you to keep all the rul
<script>
import { reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { ValidateEach } from '@vuelidate/components'
import { minLength, required } from '@vuelidate/validators'
Expand Down
16 changes: 8 additions & 8 deletions packages/docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ method.
<input type="text" :value="name" @input="setName">
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -72,7 +72,7 @@ You can link fields together, by passing a field's value to another field's vali
```vue
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { sameAs } from '@vuelidate/validators'
export default {
Expand All @@ -97,7 +97,7 @@ state. This might be very useful for overall form validation.
```vue
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { sameAs } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -220,7 +220,7 @@ You can access information about your validations through `$params`.
</template>
<script>
import { minLength } from '@vuelidate/validators'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
export default {
data: () => ({ name: '' }),
Expand All @@ -246,7 +246,7 @@ automatically. Validation's `$dirty` state is preserved even if the property tre
```vue
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -278,7 +278,7 @@ export default {
<script>
import { reactive, computed } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -356,7 +356,7 @@ Let's implement a `$warn` concept, where a validator returns a warning, if the d
</div>
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
export default {
setup () {
Expand Down Expand Up @@ -399,7 +399,7 @@ or `$commit`. This is often done on `blur` of the field.
</div>
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Each validation rule must have a corresponding property inside the `data` object
```html

<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -152,7 +152,7 @@ proceeds to update the original value.
</template>

<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -180,7 +180,7 @@ It is quite common to forget to use `$model` or `$touch`. If you want to ensure
param, when defining your validation rules.

```js
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'

export default {
Expand Down Expand Up @@ -217,7 +217,7 @@ field is `$dirty`, so after `touch()` is called, by using that property’s `$mo
This saves extra invocations for async validators as well as makes the initial validation setup a bit more performant.

```js
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'

export default {
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Once this is done, you can proceed with the below.


```js
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, email } from '@vuelidate/validators'

export default {
Expand Down Expand Up @@ -84,7 +84,7 @@ Lets explain what happens here. We declare our local state with `data`, then we
Notice how the the objects returned from `data` and `validations` have a matching structure.

```js{9-15,18-24}
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, email } from '@vuelidate/validators'
export default {
Expand Down Expand Up @@ -118,7 +118,7 @@ Vuelidate v2.x also comes with support for Composition API. The above example ca

```js
import { reactive } from 'vue' // "from '@vue/composition-api'" if you are using Vue 2.x
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, email } from '@vuelidate/validators'

export default {
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/src/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Vuelidate from 'vuelidate'
```
with
```js
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
```

2. Change import location for validators
Expand Down Expand Up @@ -116,7 +116,7 @@ Here’s the wrapper component.
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import PersonInput from '@/components/PersonInput'
export default {
Expand Down Expand Up @@ -150,7 +150,7 @@ And here we have the single person component that has its own validation rules.
</template>
<script>
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
export default {
props: {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/AsyncValidators.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<script>
import { ref, reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, helpers, minLength } from '@vuelidate/validators'
const { withAsync } = helpers
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/ChainOfRefs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<script>
import { ref } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<script>
import { reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, minLength, helpers } from '@vuelidate/validators'
import { ValidateEach } from '@vuelidate/components'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<script>
import { ref, reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, helpers, minLength } from '@vuelidate/validators'
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/I18nSimpleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<script>
import { ref, reactive, computed } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, helpers, minLength, createI18nMessage } from '@vuelidate/validators'
import { i18n } from '../i18n'
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/NestedA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<script>
import { ref } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import NestedB from './NestedB.vue'
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/NestedB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<script>
import { ref, toRefs } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, maxValue, minValue } from '@vuelidate/validators'
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/NestedValidations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<script>
import { ref, computed } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, minValue, maxValue } from '@vuelidate/validators'
import NestedA from './NestedA.vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script>
import { reactive } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, minValue } from '@vuelidate/validators'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<script>
import { reactive, ref } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
import ChildComponent from './ChildWithScope.vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/OldApiExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

<script>
import { ref, computed } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { minValue } from '@vuelidate/validators'
export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-project/src/components/SimpleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<script>
import { ref } from 'vue'
import useVuelidate from '@vuelidate/core'
import { useVuelidate } from '@vuelidate/core'
import { required, helpers, minLength } from '@vuelidate/validators'
export default {
Expand Down

0 comments on commit 791f698

Please sign in to comment.