#ng-bootstrap/ng-bootstrap multi item slider - angular2-template

I have installed a package #ng-bootstrap/ng-bootstrap for my angular project, I already implemented the carousel by it, but I need a multi-item carousel, can anybody suggest whether I can achieve it by this package or not, please suggest some tutorials.

In some research, I have not found that ng-bootstrap has a function for this at this time--Please correct me if I'm wrong.
https://github.com/ng-bootstrap/ng-bootstrap/issues/2083
If I ammm correct, since you already have the bootstrap dependency, I would import the 3 required js dependencies (popper, jquery, bootstrap.min.js)
and attempt to use something like this? (Is this what you are talking about?)
https://www.codeply.com/go/HDu8lT7NxJ

Related

Difference in HTML generated between Vue files between dev and prod

I'm new to Vue and I hope someone can help. I have an app that uses Vuetify (2.2.23), and when I render it locally for development, the HTML contains:
So, v-main is a class, and it's being located in my CSS for styling. However, in another installation from the same files (I've checked the versions of everything too), I get:
So, v-main is now an element, so the CSS is not being applied.
I realise that I can duplicate my styling so that they look the same to the user, but I'd like to understand what to look for in the setup of the projects that would make this happen in the first place?
The versions I'm using are:
Vue 2.6.11
Vuetify 2.2.23
Thanks in advance!
Why is it the thing you've checked the most is the thing that's the problem? This was a version problem after all. I used the ^ minimum requirement, and the two servers ended up using different versions. Bumping both to a minimum of Vuetify 2.3.9 solved it.
Posting this answer in case it helps someone else.

Is it possible to include vuetify in a library bundle?

I have two Vue projects, one is an app that is injected in an older website via script-tag and a second project, that is a form, that uses own logic and vuetify components. The later should be used in other projects also and gets props from where it is used. Therefore it should be compiled as a library.
If i compile it as app i can transfer data via a global JS variable, but i would like to use the components like any other library. (Just import it and put it in the <template> like so: <MyComponent ..props../>)
If i compile it as a library i got all sorts of vuetify not correctly initialized. After i cleared them my HTML looked excactly like my code (eg:<v-app>...</v-app>) without any errors.
The 'serve' from the standard installation worked without a problem in the component project.
The component project is created with vue create project and modified according to https://cli.vuejs.org/guide/build-targets.html#library
I already searched online and got only so far, my question on the vue discord was left unanswered, so my questions are:
1. Is this even possible to do?
2. If it is, could you please point me in a direction, or give a summary of what i have to do?
3. If not, is there another way of achieving this, except for copying the raw code into each project?
Short answer, yes. Is it recommended, no.
The best way to do this is to export your form component as a library so that it can be imported into other projects but exclude any dependencies like Vuetify, which should be imported separately. This avoids versioning errors.
The Vue docs on packaging for npm are useful as is this article

ngx-bootstrap Dropdown Dropright Placement

I am trying to recreate the basic dropright example for the Bootstrap 4 component: https://getbootstrap.com/docs/4.1/components/dropdowns/#dropright using Angular 6 and ngx-bootstrap (3.0.1 as of writing). I have found solutions to get the dropdown to open down (standard) or up (dropup) but dropright isn't working.
https://stackblitz.com/edit/ngx-bootstrap-dropdownplacement
From the docs, there seems to be a "placement" input - https://valor-software.com/ngx-bootstrap/#/dropdowns#dropdown-directive - but there are no examples of this and I've tried attaching it to any one of the elements dropdown, dropdownToggle or *dropdownMenu. Basically this is an important part of a sidebar menu, where the submenu dropright.
Can anyone point me in the right direction to get the dropright functionality working with ngx-bootstrap, please?
Sidenote: I have managed to get this working with ng-bootstrap but wouldn't want to switch packages if I don't really have to.
I got your point but I think this happen because of the bootstrap version.
https://getbootstrap.com/docs/4.1/components/dropdowns/#dropright
if you check this url you will see they are using bootstrap v.4.1 and you are using ngx-bootstrap, both have different CSS classes that's why you facing this issue.
If you want to fix this issue. Please do few step:
1) https://www.npmjs.com/package/bootstrap (npm install bootstrap)
2) Than include in angular-cli.json file, like -
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],
3) Remove your BsDropdownModule from app.module.ts file
If I missed anything please let me know
Thanks !!
I found the solution to make the placement work. You should add container="body" and of course placement="top right". Although it doesn't work as expected
To show it on top use [dropup]="true"

How to make Bootstrap 3 and Ant Design 3 live together

We are working on a React application (using Create React App without ejecting it) and we decided to use Ant as our base component library.
Now that we are near the end of the project, we discover that the application will be integrated into a corporate portal (WebSphere) as a "portlet", so we inherit all the CSS files from the main page.
Both frameworks seem to have their own reset styles, but they use different values.
So far, I have not been able to find a LESS variable in Ant that can be used for prefix all Ant's CSS rules.
Has anyone ever tried to make them live together?
We don't own the parent development, we can only make change on the React part, so only things related to Ant.
We finally go with a specific CSS patch file, and we add rules when needed.
Not really perfect, but none of the suggested path did the job we expected.
Here you can see some of the default antd variables.
One of them is #ant-prefix: ant;. I think you can change it and apply different styles.
That is a tough one, and at the end of development no less!
As #froston mentions, and which you seem to have tried the #ant-prefix: ant; in addition to this you will need to se prefixCls as a prop on every component instance you create, which will definitely be an exercise in self-flagellation.
Even if you set a global CONSTANT and import and use this with your components, you still have to thread it through to all the places, and will need to be appended with the component name.
By way of example, the defaultProps for an anchor is prefixCls: 'ant-anchor'.
Hope this helps and good luck!

Quill Editor and Vue.js

I'm a vue.js beginner and I've been trying to integrate the Quill editor into Vue modules. At first, I tried with the vue-quill plugin but documentation is very poor and I couldn't understand how to use it. Very frustrating.
Now I don't know if I'm better off trying to create my own plugin or if I give the existing plugin a second try and maybe try to enhance it.
What I want is someone to please provide some sample working code to get this going.
Upon inspecting the vue-quill package.json file I noticed it depended on an old version of quill :
"dependencies": {
"quill": "^0.20.1",
...
}
Since I was getting fragment errors from that build I decided to take the original code to suit my needs. At this point, you can copy this modified component and use something like vue-cli to use it.
I can't give you precise steps on vue-cli because my project is based on Laravel, but the idea of storing different .vue files into a components folder should be similar.
Finally, I simply use the component in one of my views :
<quill :content.sync="content"></quill>
Note : I am still fiddling around the component that I uploaded on gist, so take it as a starting point. The code is fairly simple.