last day (15 days later) » 

2:53 AM
Hi Andrew.. Just need quick help..
 
Hey
so what is the question?
 
the top image is what the bootstrapvue documentation - that works..
 
ah ok. It's just your syntax is different
 
the second image.. i used an arrow function.. how do i incorporate the script in the arrow function
yeah.. that is the issue..
 
so just add a comma on the last line and define a new property "checked"
the arrow function is less verbose as you are returning the object in the parentheses
Maybe I should be more specific 😅
 
2:59 AM
export default {
components: { DropdownBarItem, FeatherIcon, AddEmployee },
data: () => ({
fields: [
'Employee #', 'First Name', 'Last Name', 'Address ', 'Phone No.', 'Email', 'Picture'
],
dropdownBar: [].concat(empDnaDropdown, userDropdown),
checked:[
return="true"
]
})
};
</script>
that is what I have
 
export default {
components: { DropdownBarItem, FeatherIcon, AddEmployee },
data: () => ({
fields: [
'Employee #', 'First Name', 'Last Name', 'Address ', 'Phone No.', 'Email', 'Picture'
],
dropdownBar: [].concat(empDnaDropdown, userDropdown),
checked: true
})
};
</script>
 
So you are saying.. that the arrow means return.. so i dont have to do that?
 
the arrow pointed to anything besides a brace "{" means return
braces mark blocks is the problem
so to return an object we need to wrap it in parentheses
 
ok... it works..
but i have one last question..
 
go ahead
 
3:04 AM
what if I have more than one check box.. how i differentiate them?
I want some to be true and some to be false?
 
You can name the property whatever you want
as long as it matches the bound property in the template
one can be foo
the other bar
v-model="foo"
vs v-model-"bar"
presumably you can even bind them to array elements if you don't feel like naming things
 
so here..
v-model="checked"
you are saying i can name it anything.. strong/ array elements
 
yep, checked can be any property returned from your data method
 
then I go to script and say..
foo: true
or
bar: true
 
exactly
 
3:09 AM
I'd suggest you take a look at the vue docs to understand what `v-model` actually is/does.
https://vuejs.org/v2/guide/forms.html#Basic-Usage
 
In fact if you want vuejs to behave properly you must initialize these properties
 
thanks a lot..
Because I dont have a coding background.. reading the documents and javascript sometime make it difficult to understand..
So am great with the html section.. but script section seems to pose a challenge
 
Completely fair.
 
Yah no problem, it can be a lot to take in at once. I would urge you to spend a little more time on JS fundamentals before diving into vue
FCC has some good primers
 
If you don't plan on doing anything with the checked property that you've added to your data. You could do without the v-model and instead do checked="true" to your <b-checkbox> to have it checked by default too.
 
3:14 AM
^ yep. It will make it "unmanaged" so to speak. meaning vuejs won't control it's state.
 
Understand and thanks Hiws.. I plan to use the checked box on and off..
later down..
@AndrewGillis freecodecamp.org
that is FCC?
 
Yep exactly
 
also @AndrewGillis as a non coder who just learning.. what excite me about jumping into vuejs.. is that i get to see what I want.. the gui.. then try to figure out how to get there
my mentor says its a bad way to learn.. but ..
 
Yeah I know that feeling haha Check out FCC, they do a good job of helping you see results farily quick. The JS algorithms and data structures is where I'd start
 
perfect.. thanks a mill again..
@Hiws thank you .
 
3:20 AM
Good luck!
 
Best of luck to you. I'm sure you'll get the hang of things quickly.
But focusing on the fundamentals of JavaScript, and then Vue would be a good start, and then move on from there.
 

last day (15 days later) »