-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[next] chore(docs): update documentation #6482
base: next
Are you sure you want to change the base?
Changes from all commits
a21c911
e5af7da
2702b69
074fe4a
4833915
fcc5ef6
e6bd456
e7f8750
683de8b
2e761e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,42 +9,56 @@ | |
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
This repo contains the various Vue.js components that Nextcloud uses for its internal design and structure. | ||
> 🖼️ Nextcloud UI Kit for building Nextcloud apps with Vue | ||
|
||
# Installation | ||
- ✨ Standardized UI Components | ||
- 🛠️ Composables and frontend utilities | ||
- 🔗 [Reference providers](https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/reference.html) utilities | ||
|
||
## 📄 Documentation | ||
|
||
| Version | Target | Documentation | | ||
|----------------|-----------------------|-------------------------------------------------------| | ||
| v9.x [next] | Nextcloud 30+ (Vue 3) | https://next--nextcloud-vue-components.netlify.app | | ||
| v8.x [master] | Nextcloud 28+ (Vue 2) | https://nextcloud-vue-components.netlify.app | | ||
| v7.x [stable7] | Nextcloud 25 - 27 | https://stable7--nextcloud-vue-components.netlify.app | | ||
| v6.x [stable6] | Nextcloud 24 - 25 | https://stable6--nextcloud-vue-components.netlify.app | | ||
|
||
## 📦 Install | ||
|
||
```bash | ||
npm i --save @nextcloud/vue | ||
npm i @nextcloud/vue | ||
``` | ||
|
||
# Usage | ||
## 🚀 Usage | ||
|
||
Import corresponding components and other modules on use. Check the documentation for more details. | ||
|
||
```js static | ||
import { NcAppNavigation } from '@nextcloud/vue' | ||
|
||
export default { | ||
name: 'MyComponent', | ||
components: { | ||
NcAppNavigation | ||
} | ||
} | ||
``` | ||
import NcButton from '@nextcloud/vue/components/NcButton' | ||
import { useHotKey } from '@nextcloud/vue/composables/useHotKey' | ||
|
||
You can also import individual module without bundling the full library. | ||
// (Deprecated) Old import path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can also be removed for |
||
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' | ||
import { useHotKey } from '@nextcloud/vue/dist/Composables/useHotKey.js' | ||
``` | ||
|
||
Import from a single root is available as well. Use with caution: this might lead to slower build time and larger bundles in some cases. | ||
|
||
```js static | ||
import NcAvatar from '@nextcloud/vue/components/NcAvatar' | ||
import { NcButton, useHotKey } from '@nextcloud/vue' | ||
``` | ||
|
||
## Recommendations | ||
### (Deprecated) Registering all components | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this section can go now, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I though, I checked every commit on backport 🙈 |
||
|
||
`NextcloudVuePlugin` registers all the components and directives globally. | ||
|
||
Some components require Nextcloud functionality to work, so it is currently recommended to extend Vue with the following: | ||
> ⚠️ This installation method leads to extremely large bundle and removed in v9.\ | ||
> If you don't want to import component on usage you may use [unplugin-vue-components](https://github.com/unplugin/unplugin-vue-components) instead. | ||
|
||
```js static | ||
Vue.prototype.OC = window.OC | ||
Vue.prototype.OCA = window.OCA | ||
``` | ||
import Vue from 'vue' | ||
import { NextcloudVuePlugin } from '@nextcloud/vue' | ||
|
||
<a href="https://www.netlify.com"> | ||
<img src="https://www.netlify.com/img/global/badges/netlify-dark.svg"/> | ||
</a> | ||
Vue.use(NextcloudVuePlugin) | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this as well 🙂