🍱 Vue.js components for Nextcloud app development ✌ https://npmjs.org/@nextcloud/vue
Перейти к файлу
Vincent Petry 1afc2c917b
Bump nextcloud-dialogs from 3.1.2 to 3.1.4
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-07-21 16:02:38 +02:00
.github Merge pull request #2759 from nextcloud/feat/workflow-auto-update-node.yml 2022-06-15 10:27:02 +02:00
build Fix translation extraction 2021-03-28 23:38:29 +02:00
cypress Update AppSidebar snapshots 2022-07-12 19:38:04 +00:00
docs Don't rely on Vue.prototype.t 2021-09-10 22:11:42 +02:00
l10n Merge pull request #2825 from nextcloud/translations_l10n-messages-pot--master_cs_CZ 2022-07-15 10:30:51 +02:00
resources/timezones Separate words in descriptions 2021-07-21 13:55:58 -07:00
src Make captions real headings for improved a11y 2022-07-20 15:57:35 +02:00
styleguide Migrate from node-sass to sass 2022-04-09 18:01:00 +02:00
tests Bump cypress from 6.8.0 to 9.5.3 2022-04-07 12:00:05 +02:00
.editorconfig Init component structure 2018-08-17 16:57:42 +02:00
.eslintrc.js Add emoji autocompletion 2021-12-27 10:41:00 +01:00
.gitignore Add changelog file 2020-11-25 17:57:34 +01:00
.stylelintignore Icon font 2019-01-07 17:06:57 +01:00
CHANGELOG.md 5.3.1 2022-04-08 10:53:19 +02:00
LICENSE Copyright typo fix 2018-10-26 10:50:25 +02:00
Makefile Fix old import 2020-03-26 09:55:37 +01:00
README.md Update sample diff for Nextcloud 25 2022-07-20 11:07:44 +02:00
babel.config.js Fix babel 2021-04-14 08:08:07 +02:00
cypress.json Bump cypress from 6.8.0 to 9.5.3 2022-04-07 12:00:05 +02:00
package-lock.json Bump nextcloud-dialogs from 3.1.2 to 3.1.4 2022-07-21 16:02:38 +02:00
package.json Bump nextcloud-dialogs from 3.1.2 to 3.1.4 2022-07-21 16:02:38 +02:00
styleguide.config.js Add Dashboard documentation 2022-05-04 09:42:26 +02:00
stylelint.config.js Move to npm 7 & update global configs 2021-07-27 10:58:57 +02:00
webpack.common.js Do not lint during build 2022-04-20 15:16:52 +02:00
webpack.dev.js Bump webpack-merge from 4.2.2 to 5.0.8 2020-07-08 13:08:32 +02:00
webpack.prod.js Update to webpack 5 2022-04-05 15:15:28 +02:00

README.md

Vue components

npm last version Dependabot status

This repo contains the various Vue.js components that Nextcloud uses for its internal design and structure. It provides standardized UI elements for building Nextcloud app frontends with Vue.js.

Documentation

A list of available components with examples to try out is available in the documentation.

Getting started

App example

If you want to check a real live example of a nextcloud app that uses this library, you can head over to https://github.com/skjnldsv/vueexample/ We will try to maintain this repository the best we can, but some example might be obsolete. Always check this repository documentation.

Install the library

npm i --save @nextcloud/vue

Usage

To use a component, just import it:

import { AppNavigation } from '@nextcloud/vue'

Depending on which components you use, you might want to only import individual (separately bundled) components:

import Avatar from '@nextcloud/vue/dist/Components/Avatar'

Development setup

If you want to work on improving the components its best to run the latest code and link it to your local Nextcloud installation:

  1. Install the dependencies with npm ci
  2. Build the components every time you do changes: npm run build
  3. Connect it to your local Nextcloud development setup:
    • In this repository do npm link
    • In the repository of an app do npm link @nextcloud/vue (you need to re-link any time you do npm ci in the app)
  4. Then build the app with: npm run build (or watch for changes with npm run watch)

Styleguide

When developing new components or extending compnents, make sure to also have some bits of related documentation like examples, where applicable. To test components and the documentation in that context, you can run npm run styleguide to run a local server that serves the style guide with all the components.

Using vue-devtools in Firefox

If you want to use vue-devtools in Firefox, you need to patch your nextcloud instance as follow:

diff --git a/lib/public/AppFramework/Http/ContentSecurityPolicy.php b/lib/public/AppFramework/Http/ContentSecurityPolicy.php
index 0e3a6a705d..416b8b0fb9 100644
--- a/lib/public/AppFramework/Http/ContentSecurityPolicy.php
+++ b/lib/public/AppFramework/Http/ContentSecurityPolicy.php
@@ -41,9 +41,9 @@ namespace OCP\AppFramework\Http;
  */
 class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
        /** @var bool Whether inline JS snippets are allowed */
-       protected $inlineScriptAllowed = false;
+       protected $inlineScriptAllowed = true;
        /** @var bool Whether eval in JS scripts is allowed */
-       protected $evalScriptAllowed = false;
+       protected $evalScriptAllowed = true;
        /** @var bool Whether strict-dynamic should be set */
        protected $strictDynamicAllowed = false;
        /** @var array Domains from which scripts can get loaded */

Releasing a new version

  • Pull the latest changes from master or stableX;
  • Checkout a new branch with the tag name (e.g v4.0.1): git checkout -b v<version>;
  • Run npm version patch --no-git-tag-version (npm version minor --no-git-tag-version if minor). This will return a new version name, make sure it matches what you expect;
  • Commit, push and create PR;
  • Add the change log content from the 'Changelog' action on Github to CHANGELOG.md;
  • Commit and push;
  • Get your PR reviewed and merged;
  • Create a release on github with the version as tag (e.g v4.0.1) and add the changelog content as description (https://github.com/nextcloud/nextcloud-vue/releases); image