Input
корявый, должен в эмитить current.value
, а не current
.() => {
body: data
})
(axios всё непонятное отправляет как строку).<script>
глобальную версию и написав vue- шаблоны прям в html\php. null
- используешь второй вариант, где передаёшь объект только с нужными ключами: changePhone({ newPhone: '123' })
.changePhone(newPhone:='123')
как в некоторых языках, то в js(и, соответственно, ts) такого нет и, скорее всего, не будет. changePhone = async (phone: string | null = null, newPhone: string | null = null, code: string | null = null) => {
const data: {
phone?: string,
newPhone?: string,
code?: string,
} = {};
if (phone !== null)
data.phone = phone;
if (newPhone !== null)
data.newPhone = newPhone;
if (code !== null)
data.code = code;
return await this.axiosCall({
method: 'post',
url: '/change/phone',
data,
})
}
changePhone = async (data: {
phone?: string,
newPhone?: string,
code?: string,
}) => {
return await this.axiosCall({
method: 'post',
url: '/change/phone',
data,
})
}
ts - https://github.com/nonara/ts-patch#recommended-reading
babel - https://github.com/jamiebuilds/babel-handbook/blob...
webpack - https://webpack.js.org/contribute/writing-a-loader/