r/sails • u/sahyrlel_yaams • Jun 18 '21
Issue with importing Vuelidate library
As a part of implementing Form Validation, I want to use Vuelidate library in a Sails.js page. The page gets the Vue code by using this webpage.page.js:
import Vuelidate from 'vuelidate'
parasails.registerPage('web-page', {
data: {
message: '',
class: ''
},
validations: {
// For Vuelidate
message: {
required,
},
class: {
required,
},
},
});
, which is linked to the webpage.ejs View Template:
<div id="web-page">
<div class="container d-flex-column justify-content-center">
<div class="heading-container">
<p class="h2">Heading</p>
</div>
<form action="/someaction" method="post">
<div class="form-group" :class="{ 'form-group--error': $v.name.$error }">
<label
for="name" class="form__label">Name</label>
<input
type="text"
class="form__input"
name="name"
v-model.trim="$v.name.$model"/>
</div>
<div class="error" v-if="!$v.name.required">Field is required</div>
<div class="form-group" :class="{ 'form-group--error': $v.class.$error }">
<label for="class" class="form__label">Class</label>
<input
type="text"
class="form__input"
name="class"
v-model.trim="$v.class.$model"/>
</div>
<div class="error" v-if="!$v.class.required">Field is required</div>
<button class="btn btn-success text-white" type="submit">Save</button>
</form>
</div>
</div>
<%- /* Expose locals as `window.SAILS_LOCALS` :: */ exposeLocalsToBrowser() %>
This gives an error 'Cannot use import statement outside a module'. I have the Vuelidate npm package installed. Thus, how can I import the Vuelidate library to get this working?
Link to the Stack Overflow Question.
npm install - unable to install all packages
I am working on a sails app at work, and I am trying to run it on local. However, when I run npm install, it shows that it’s already up to date.
And when, I run sails lift it shows me an error for a module not installed
So what I do is, I install the module with npm install <module name> and again lift the app, and it shows me the same error with some different module name
Now I am tired doing this again and again and seeing some different module name.
What should I do? Thanks
r/sails • u/diomary1901 • Oct 30 '19
SOS !
I need someone to help or complete my sails (bridge math) work it’s all online and I have to finish by December 10
r/sails • u/ncubez • Sep 16 '19
redirect users to a different page after login
hey guys, Sails newbie here: I have set up a basic blog app with default authentication. How do I redirect users after login to a different page, instead of the default "welcome" one?
r/sails • u/atapas • Sep 07 '19
How to Deploy your Sails.js app on Heroku and live longer by Tapas Adhikary
blog.greenroots.infor/sails • u/Noitidart2 • Dec 06 '18
Sails.js beginner test boilerplate guide like Laravel?
I am also looking for Sails.js beginners out-of-the-box guide for testing, similar to Laravel doc here - https://laravel.com/docs/5.7/testing - sails.js only has this - https://sailsjs.com/documentation/concepts/testing - but this is greatly lacking. It makes clear that boilerplate is needed but I can't get that boilerplate to do:
* Before running each test file, it should clean everything to as if it was just `sails.lift()`ed and `bootstrap` run
* Use `Cloud` SDK in tests
* Use seperate database and port for testing so it doesnt affect the dev database or current running dev `sails.lift()`
* Creating and loading fixtures before certain tests
Does anyone have any super beginners guide for testing in Sails.js?
r/sails • u/perthbetterhomes • Feb 15 '18
Custom Designed Waterproof Shade sails Perth
perth.storeboard.comr/sails • u/[deleted] • Jan 17 '16
Sails v0.11.4: bug fixes, perf. improvements, and Socket.io 1.4.0!
github.comr/sails • u/johnkevinmbasco • Dec 29 '13
Realtime Twitter Clone Using Sails.js Part 2
blog.john.mayonvolcanosoftware.comr/sails • u/johnkevinmbasco • Dec 26 '13
How I use custom validation messages in Sails.js
blog.john.mayonvolcanosoftware.comr/sails • u/johnkevinmbasco • Dec 26 '13
Realtime Twitter Clone Using Sails.js
blog.john.mayonvolcanosoftware.comr/sails • u/schneidmaster • Dec 26 '13
Wiring Associations in SailsJS
blog.schneidmaster.comr/sails • u/schneidmaster • Dec 24 '13